Skip to content

Handle float type in positive number (CLIUtils#328) - #342

Merged
henryiii merged 6 commits into
CLIUtils:masterfrom
ChristosT:devel-positive-float
Nov 25, 2019
Merged

henryiii merged 6 commits into
CLIUtils:masterfrom
ChristosT:devel-positive-float

Conversation

@ChristosT

Copy link
Copy Markdown
Contributor

This PR enables checking positivity of float types , providing a fix to #328.
Numbers are handled as doubles in the same way that CLI:Number is structured

class Number : public Validator {
public:
Number() : Validator("NUMBER") {
func_ = [](std::string &number_str) {
double number;
if(!detail::lexical_cast(number_str, number)) {

Also, aCLI:NonNegative is added and checks if number <=0 while CLI:Positive is modified to check whether number>0

@codecov

codecov Bot commented Nov 12, 2019 •

Copy link
Copy Markdown

Codecov Report

Merging #342 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #342   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          12     12           
  Lines        3331   3341   +10     
=====================================
+ Hits         3331   3341   +10
Impacted Files Coverage Δ
include/CLI/Validators.hpp 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 418b717...367924e. Read the comment docs.

@henryiii
henryiii merged commit 51a395e into CLIUtils:master Nov 25, 2019
@henryiii

Copy link
Copy Markdown
Collaborator

Thanks!

@henryiii henryiii added this to the v1.9 milestone Dec 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants