Skip to content

fix(weekday): accept a period after abbreviated weekday names - #334

Open
anasbekheit wants to merge 2 commits into
uutils:mainfrom
anasbekheit:fix/weekday-abbrev-period
Open

anasbekheit wants to merge 2 commits into
uutils:mainfrom
anasbekheit:fix/weekday-abbrev-period

Conversation

@anasbekheit

Copy link
Copy Markdown

The weekday parser matched with alpha1, which never consumes ., so the existing "mon.", "tue.", … arms could never match and inputs like mon. or wed., 2024-01-03 were rejected. GNU date accepts a period after the three-letter abbreviation. The parser now includes an optional trailing period in the word.

@anasbekheit

Copy link
Copy Markdown
Author

@cakebaker I think this PR may improve GNU test parity.

@anasbekheit
anasbekheit marked this pull request as ready for review September 26, 2026 04:45
@codecov

codecov Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.49%. Comparing base (e25bf15) to head (1fae3fd).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #334      +/-   ##
==========================================
+ Coverage   97.48%   97.49%   +0.01%     
==========================================
  Files          21       21              
  Lines        4258     4279      +21     
  Branches      136      136              
==========================================
+ Hits         4151     4172      +21     
  Misses        106      106              
  Partials        1        1              
Flag Coverage Δ
macos_latest 97.49% <100.00%> (+0.01%) ⬆️
ubuntu_latest 97.49% <100.00%> (+0.01%) ⬆️
windows_latest 12.10% <4.54%> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread src/items/weekday.rs

fn day(input: &mut &str) -> ModalResult<Day> {
s(alpha1)
s((alpha1, opt('.')).take())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add a test with the full parser, like parse_datetime("wed., 2024-01-03")
the existing "mon." unit tests already passed before, they don't check that the whole input was consumed

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a new commit

@anasbekheit

Copy link
Copy Markdown
Author

Are there any concerns blocking the merge of this PR?
@sylvestre @xtqqczze

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants