Skip to content

test: make all gnu test pass and fix access issue - #14966

Open
anastygnome wants to merge 3 commits into
uutils:mainfrom
anastygnome:test-util
Open

anastygnome wants to merge 3 commits into
uutils:mainfrom
anastygnome:test-util

Conversation

@anastygnome

@anastygnome anastygnome commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

The implementation of test parsing was not all encompassing and missed a lot of cases from GNU. Notably test would process short expressions in a special way, which was absent in uutils. One test went against coreutils, probably because by default test uses a shell builtin.

This PR fixes all of the issues, at the expense of a comprehensive rewrite of the parser (sorry!). But it is at least a sane base to work upon.

closes #13197

@anastygnome
anastygnome force-pushed the test-util branch 2 times, most recently from 3e9defe to ec367ff Compare September 29, 2026 19:29
@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Binary size comparison:

Individual binary size comparison VS main (threshold: >=5% AND >=4 KB).

Total size of compared binaries: 155.68 MB (+2.43 MB, +1.58%)

Significant per-binary changes:
  [        1.12 MB ->    2.32 MB  (+1.20 MB, +107.32%)
  test     1.12 MB ->    2.32 MB  (+1.20 MB, +107.32%)

@anastygnome anastygnome changed the title test: adress test failures by evaluating expressions directly and separating special cases test: rework expression parsing for GNU compatibility Sep 29, 2026
@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

GNU testsuite comparison:

Congrats! The gnu test tests/test/test is no longer failing!

@anastygnome
anastygnome force-pushed the test-util branch 2 times, most recently from 559b9a1 to f004f3d Compare September 29, 2026 20:45
@anastygnome
anastygnome marked this pull request as ready for review September 29, 2026 20:45
@anastygnome
anastygnome force-pushed the test-util branch 3 times, most recently from 9271b01 to 8d6deae Compare September 30, 2026 05:41
@anastygnome

Copy link
Copy Markdown
Contributor Author

@sylvestre looking good to me!

@anastygnome anastygnome changed the title test: rework expression parsing for GNU compatibility test: make all gnu test pass Sep 30, 2026
@anastygnome
anastygnome force-pushed the test-util branch 2 times, most recently from 7317cff to 7a0bbc4 Compare September 30, 2026 11:05
@anastygnome

anastygnome commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor Author

@cakebaker can you review?

`test` has special rules for expressions with one through four arguments.
Keeping a postfix `Symbol` stack makes those cases harder to follow and clones
`OsString`s while looking ahead.

Evaluate directly from the argument slice instead. Keep the short forms
explicit, then use the usual `!`, `-a`, `-o` precedence for longer expressions.
This also fills in GNU-compatible `-l` integer operands, locale ordering for
`<` and `>`, and the `-t` overflow case.

This matches GNU logic, and makes the test pass.
@anastygnome anastygnome changed the title test: make all gnu test pass test: make all gnu test pass and fix access issue Oct 1, 2026

This branch has not been deployed

No deployments
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.

"test" does not use access syscall for testing permissions

1 participant