Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 6 commits into from
Nov 25, 2019

Conversation

ChristosT
Copy link
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
Copy link

codecov bot commented Nov 12, 2019

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
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