-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
tests(ls): Add GNU-compat TIME_STYLE tests (#4627) #8796
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
Add comprehensive test coverage for ls TIME_STYLE behavior to align with GNU coreutils: - test_ls_time_style_env_full_iso: TIME_STYLE environment variable with full-iso format - test_ls_time_style_iso_recent_and_older: --time-style=iso formatting for recent vs older files - test_ls_time_style_posix_locale_override: Locale-based fallback with LC_ALL=POSIX - test_ls_time_style_precedence_last_wins: Precedence between --full-time and --time-style - test_ls_time_sort_without_long: Time-based sorting without -l flag These tests directly address remaining gaps highlighted in uutils#4627 for tests/ls/ls-time.sh from the GNU test suite.
|
GNU testsuite comparison: |
CodSpeed Performance ReportMerging #8796 will not alter performanceComparing Summary
Footnotes
|
cakebaker
reviewed
Oct 3, 2025
cakebaker
reviewed
Oct 3, 2025
cakebaker
reviewed
Oct 3, 2025
- Replace #[cfg(feature = "touch")] with set_modified(UNIX_EPOCH) in test_ls_time_style_iso_recent_and_older - Remove conditional blocks in test_ls_time_sort_without_long and set mtimes via set_modified - Simplify assertion to assert_ne!(def, t) to compare full outputs Rationale: Improves determinism, portability, and reduces branching as suggested by maintainer cakebaker in PR review comments.
|
GNU testsuite comparison: |
Contributor
|
Thanks! |
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.
Part of #4627 (split from #8684 per maintainer request)
Adds focused test coverage for GNU-compatible TIME_STYLE behavior and related precedence/sorting:
These map to GNU tests in tests/ls/ls-time.sh. Tests are written to be robust across platforms (using TZ=UTC and regex validations).
Tracked at #4627