grass.gunittest: Allow floating point for --min-success
argument
#5278
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Making gunittest accept floating points for
--min-success
was a one word change, and already worked correctly.I just followed up by making the percentage displayed with a decimal point, and extracting the repeated nested function as noted in a todo note; they were exactly the same and didn't use anything from the outer context, both were "pure functions", and could've been static functions in other languages.
I tried it out on the vector folder, making sure I didn't compile with some required libraries so some tests would fail (for example, no pdal, so v.in.lidar and v.in.pdal would fail)
For 19/31=0.6129032258064516, using 66.7 fails:
For 19/31=0.6129032258064516, using 61.2 passes: