Add more tests for parse_from_str and specifiers#1122
Add more tests for parse_from_str and specifiers#1122jtmoon79 wants to merge 1 commit intochronotope:0.5.xfrom
parse_from_str and specifiers#1122Conversation
fa15d84 to
26cd263
Compare
|
@djc this PR is not complete. Let me know if you'd consider accepting this and then I'll complete it (add tests for all Before submitting a fix for PR #807 which caused Bug #1112, I'd like to create more exhaustive testing for parsing. There is already test |
|
I have to admit all the test failures when i was working on the parsing of |
|
@jtmoon79 The last commit in https://github.com/pitdicker/chrono/commits/parse_padding is what I was thinking it would take to work with whitespace in combination with padding specifiers. Just putting it in here to spare some double work. |
I'll submit something in a few days or so. |
|
I'd like to get away from the idea that more tests is always better -- lots of tests mean slower test runs and making the code harder to refactor. I think we should have coverage in place first, and then figure out how we improve coverage. IMO for a battery of new tests like this I also think it should be more obvious in the code what each test is supposed to cover. |
|
I don't feel like we have huge gaps in our coverage of parsing. More tests is not per se better, as we have to maintain and fix merge conflicts in tests like this (which currently takes more effort than I like and would have expected). @jtmoon79 Do you want to create more targeted tests for parts of the code where we have low coverage? Either because of actual issues that point to such or the coverage data? |
Add exhaustive set of tests for `DateTime<FixedOffset>::parse_from_str` function and all strftime specifiers. Issue chronotope#1112
26cd263 to
94e3b9a
Compare
I entirely forgot about this PR! 🙀
IMO #1112 is evidence this is not the case. I'd like to submit something for that. But the code has changed quite a lot so I need to fixup this PR. |
No worries 😄.
Well that's a good argument. May I suggest a ca. 20-line test for the four cases of padding specifiers (default, none, zero or space) and their interaction with preceding whitespace or a trailing zero? |
Add exhaustive set of tests for
DateTime<FixedOffset>::parse_from_strfunction and all strftime specifiers.Issue #1112