Skip to content

Conversation

@naoNao89
Copy link
Contributor

@naoNao89 naoNao89 commented Oct 3, 2025

Part of #4627 (split from #8684 per maintainer request)

Adds focused test coverage for GNU-compatible TIME_STYLE behavior and related precedence/sorting:

  • test_ls_time_style_env_full_iso
  • test_ls_time_style_iso_recent_and_older
  • test_ls_time_style_posix_locale_override
  • test_ls_time_style_precedence_last_wins
  • test_ls_time_sort_without_long

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

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.
@github-actions
Copy link

github-actions bot commented Oct 3, 2025

GNU testsuite comparison:

Skipping an intermittent issue tests/misc/tee (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/timeout/timeout (passes in this run but fails in the 'main' branch)

@codspeed-hq
Copy link

codspeed-hq bot commented Oct 3, 2025

CodSpeed Performance Report

Merging #8796 will not alter performance

Comparing naoNao89:test/ls-time-style-gnu-compat (d8a7be0) with main (b4f8eac)

Summary

✅ 65 untouched
⏩ 73 skipped1

Footnotes

  1. 73 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

- 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.
@github-actions
Copy link

github-actions bot commented Oct 3, 2025

GNU testsuite comparison:

Skipping an intermittent issue tests/misc/tee (passes in this run but fails in the 'main' branch)

@cakebaker cakebaker merged commit 0554a20 into uutils:main Oct 4, 2025
96 of 97 checks passed
@cakebaker
Copy link
Contributor

Thanks!

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