Skip to content

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

Merged
sylvestre merged 3 commits into
uutils:mainfrom
anasbekheit:fix/weekday-abbrev-period
Oct 11, 2026
Merged

sylvestre merged 3 commits into
uutils:mainfrom
anasbekheit:fix/weekday-abbrev-period

Conversation

@anasbekheit

Copy link
Copy Markdown
Contributor

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
Contributor 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.71%. Comparing base (701f5a0) to head (6943f5d).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #334      +/-   ##
==========================================
+ Coverage   97.70%   97.71%   +0.01%     
==========================================
  Files          21       21              
  Lines        4395     4418      +23     
  Branches      138      138              
==========================================
+ Hits         4294     4317      +23     
  Misses        100      100              
  Partials        1        1              
Flag Coverage Δ
macos_latest 97.71% <100.00%> (+0.01%) ⬆️
ubuntu_latest 97.71% <100.00%> (+0.01%) ⬆️
windows_latest 12.33% <4.16%> (-0.07%) ⬇️

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
Contributor 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
Contributor Author

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

Comment thread src/lib.rs
Comment thread src/lib.rs Outdated
@anasbekheit
anasbekheit force-pushed the fix/weekday-abbrev-period branch from f068cd8 to 6943f5d Compare October 11, 2026 11:09
@anasbekheit

Copy link
Copy Markdown
Contributor Author

branch is rebased, with issues addressed @sylvestre

@sylvestre
sylvestre merged commit de62667 into uutils:main Oct 11, 2026
21 checks passed
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