Closed samip77 closed 5 months ago
What does this PR do? The difference between two date times had wrong test case which was hiding the actual issue.
The documentation for diff function mentioned:
/// The optional [asFloat] parameter determines whether to return the /// difference as a floating-point number. The default value is [false]. ///
but the asFloat default value was true
num diff(Jiffy jiffy, {Unit unit = Unit.microsecond, bool asFloat = true}) { return _display.diff(dateTime, jiffy.dateTime, unit, asFloat); }
and in the inner function the logic was wrong
return asFloat ? _asFloor(diff) : diff;
Along with that the test case has wrong assumption, because of which it passed the test.
Issue Reference
Fixes #
Types of changes
Screenshots
If applicable, add screenshots to help explain your problem.
Checklist
./bin
Additional Information
@samip77 Thanks for the contribution, will take a look
Thanks, I had missed few test cases. updated them as well.
What does this PR do? The difference between two date times had wrong test case which was hiding the actual issue.
The documentation for diff function mentioned:
but the asFloat default value was true
and in the inner function the logic was wrong
return asFloat ? _asFloor(diff) : diff;
Along with that the test case has wrong assumption, because of which it passed the test.
Issue Reference
Fixes #
Types of changes
Screenshots
If applicable, add screenshots to help explain your problem.
Checklist
./bin
folderAdditional Information