Repository navigation
Conversation
Author
|
hi - any chance someone could approve the workflows to run? I've got bandwidth to work on some stuff here so if I can get feedback on this PR I'm happy to pick up some other tasks in addition to adding some of the missing marine sentences I'd like included in this crate. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Hi -
I'm looking to contribute to this project to add some sentences needed in the marine space. I figured I would try to pick up some of the "Good first task" / "Help Wanted" as a first step.
This adds tests for:
parse_hms/parse_duration_hms: hour 24, minute 60, second 60, negative seconds,inf/NaN, non-digits, truncated input, missing comma, and the 00:00:00 / 23:59:59.999 boundariesparse_date: month 0/13, day 0/32, 31 April, 30 February, 29 February in leap and non-leap yearsdo_parse_lat_lon: exactly 90°/180° (valid) vs. the smallest step past them, minutes ≥ 60, wrong/missing/lowercase hemisphereparse_until_end,number,parse_num: previously untested; overflow, sign and empty inputI figured adding these in one PR was ok since it's ~135 lines. If you'd prefer more bite size just LMK.
Uncovered lines in
utils.rsgo from 13 to 3.The remaining 3 lines are unreachable (I think): the two
!is_finite()checks (the float parser already rejectsinf/NaN) and theunreachable!()indo_parse_magnetic_variation.Two things I found while writing these, left out of this PR:
parse_hms("125959.9999999999,")returns12:59:60. The fractional part rounds up to 1_000_000_000 ns, which chrono treats as a leap second. Happy to send a separate fix if you'd like it to return an error instead.parse_hmsrejects-0seconds (is_sign_negative), butparse_duration_hmsaccepts it (seconds < 0.0). Minor; I can align them if you want.Thanks!