Repository navigation
Conversation
Keep ddd and dddd from overwriting the calendar date and cover printd/scand round trips for every weekday in either token order.
Snuffleupagus
left a comment
Collaborator
There was a problem hiding this comment.
Also, please stop posting walls of fully AI generated text when opening PRs.
Comment on lines
+1401
to
+1407
| for (const format of [ | ||
| "yyyy-mm-dd ddd", | ||
| "yyyy-mm-dd dddd", | ||
| "ddd yyyy-mm-dd", | ||
| "dddd yyyy-mm-dd", | ||
| ]) { | ||
| it(`should preserve the day of the month in ${format}`, async () => { |
Collaborator
There was a problem hiding this comment.
Generating test-cases within loops is not a good pattern to use, despite what your AI might "think".
Author
There was a problem hiding this comment.
Fair point, that made the cases unreadable. Rewritten as six plain calls with one literal expected array; the loop is gone.
Generating the expectations in a loop hides which format/value pair a failure refers to, so list the six calls and the one result array.
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.
util.scand()overwrote the day of the month with the index of the matched weekday name: forddd/ddddit diddata.day = days.indexOf(value), i.e. a value in 0..6. Soscand("yyyy-mm-dd ddd", "2026-10-25 Sun")produced a date at the end of September instead of 2026-10-25, and any format containing a weekday name was broken.A weekday name doesn't say anything about the day of the month, so those two handlers now just consume the token.