Commit Graph
29 Commits
Author SHA1 Message Date
Sylvestre LedruandGitHub b2c4e0c125 factor: emit GNU 9.11 'is not a valid positive integer' for stdin input (#12137)
* factor: emit GNU's 'X is not a valid positive integer' wording

GNU's factor.c routes both stdin and command-line input through the same
print_factors() and reports invalid input as
  factor: 'X' is not a valid positive integer
Match that wording exactly so the new GNU 9.11 'nul4' test passes and
the 'cont' test no longer needs the warning/invalid-digit hunk in
tests_factor_factor.pl.patch.

* Add 'cmdline' to spell-checker ignore list
2026-05-04 09:31:59 +02:00
Sylvestre LedruandGitHub 9de73ef9be tests: patch GNU numfmt 'neg-arg-not-option' to accept clap-style error (#12123) 2026-05-03 09:56:18 +02:00
oech3andGitHub dad3249a58 GnuTests: bump GNU version to 9.11 (#11922) 2026-04-23 08:38:58 +02:00
Sylvestre Ledru 8d03a6aaf9 numfmt: add GNU test patch for devdebug, help-1, and field-range errors
GNU test: numfmt.pl devdebug-*, help-1, field-1, field-range-err-*
2026-04-04 23:24:46 +02:00
Daniel HofstetterandGitHub 8cfb32714c cut: improve some error messages (#11338) 2026-03-15 23:34:07 +01:00
oech3andGitHub dc982b1444 GnuTests: 9.10, remove a bunch of backported tests (#10721) 2026-02-07 18:11:26 +01:00
Aaron AngandGitHub c9c78b2415 chore: run pre-commit on all files (#10119) 2026-02-04 22:12:53 +01:00
mattsuandGitHub 0f8eb45ebd tsort: gnu misc tsort.pl (#9289)
* test: add comprehensive test coverage for tsort cycle detection and graph topologies

- Introduce new test cases for cycle loops in file inputs, including extra nodes and multiple loops
- Add tests for POSIX graph examples and linear tree graphs to validate topological sorting
- Include tests for error handling on odd token counts and multiple file inputs
- Ensures robustness and correctness of tsort implementation across various edge cases and standard scenarios

* refactor(tests): consolidate multi-line string constants to single-line literals in tsort test file

- Reformatted TSORT_LOOP_STDERR_AC and TSORT_UNEXPECTED_ARG_ERROR constants for improved code readability and consistency, with no change in string content or functionality. The multi-line format was merged into single lines to align with potential linting rules or style preferences for string literals in tests. This refactoring enhances maintainability without affecting test logic.

* feat(tsort): add hidden warn flag and reverse successor iteration order

- Added `ArgAction` import and a new hidden `-w`/`--warn` argument to the tsort command for future warning features
- Modified iteration of successor names to use `.into_iter().rev()` in the topological sorting algorithm to process nodes in reverse order, ensuring more stable and predictable output sequence
- Refactored Clap error localization in `clap_localization.rs` to use `print_prefixed_error()` method instead of direct `eprintln!` calls, improving consistency in error message formatting across the application

* fix(test): prefix uniq error messages with program name

Update expected error outputs in uniq tests to match the new format where error messages are prefixed with "uniq: ". This ensures test cases align with the updated error message formatting in the utility, providing clearer error identification by including the program name at the start of each error message. Changes affect multiple test assertions for invalid options and incompatible argument combinations.

* fix(test): update chroot error assertion to include command prefix

The expected error message now starts with "chroot: " to match the updated output format in the chroot utility. This ensures the test accurately reflects the command's behavior.

* fix(test/chroot): update error message assertion to match standardized format

Remove "chroot: " prefix from expected error output, aligning the test with the updated stderr format that omits utility name redundancy in error messages.

* fix: update uniq error messages in tests, removing 'uniq: ' prefix

Remove the 'uniq: ' prefix from expected error messages in test cases to match the updated output format of the uniq utility, ensuring tests pass with the current implementation. This change affects multiple GNU compatibility tests for invalid options and argument conflicts.

* fix(comm): update test assertion to match actual error message without 'comm: ' prefix

The stderr assertion in test_comm_arg_error was expecting an error message prefixed with "comm: ", but the actual command output does not include this prefix. This update fixes the test to align with the real behavior, ensuring the test passes correctly.

* refactor(clap_localization): replace print_prefixed_error with direct stderr output in ErrorFormatter

Replace the call to self.print_prefixed_error with direct eprintln for printing unexpected argument errors, and add an additional blank line for better formatting and readability in error messages. This change aims to simplify the output process and ensure consistent error presentation in the clap localization module.

* refactor(clap_localization): remove prefixed error printing and use direct eprintln for cleaner output

Modified error handling in clap_localization.rs to eliminate the utility name prefix by replacing self.print_prefixed_error calls with direct eprintln! invocations. This simplifies the codebase and changes error message formatting to display clap errors without the preceding util name. Removed the unused print_prefixed_error method.

* test(tests/tsort): ignore test for single input file until error message is corrected

- Added #[ignore] attribute to test_only_one_input_file to skip it during execution.
- Reason: Test likely fails due to an incorrect error message; this prevents false negatives while the message is being fixed in the tsort utility.

* feat(tsort): reject multiple input arguments with custom error

- Change FILE arg to accept zero or more inputs (appended), defaulting to "-" if none
- Add validation to error on more than one input with "extra operand" message
- Update test to expect new error format, matching GNU tsort behavior
- Unignore test_only_one_input_file after error message correction

* refactor: format TSORT_EXTRA_OPERAND_ERROR constant for readability

Split the TSORT_EXTRA_OPERAND_ERROR constant string into multiple lines
to improve code formatting and adhere to line length guidelines.

* chore: remove tests_tsort.patch from gnu-patches series

Removed the tests_tsort.patch entry as it is no longer applied, possibly due to upstream integration or obsolescence, to keep the patch series current and relevant.

* fix(tsort): simplify error message construction by removing .into() wrapper

Remove unnecessary `.into()` call when creating the extra operand error in uumain,
resulting in cleaner, more concise error handling code. This change does not alter
the program's functionality but improves code readability and reduces nesting.

* feat: internationalize error messages in tsort command

Add localized strings for 'extra operand' and 'at least one input' errors in en-US and fr-FR locales. Update code to use translate! macro for consistent error reporting across languages, improving user experience for international users.

* fix(tsort): ensure expect message is &str by calling .as_str()

The translate! macro returns a String, but expect() requires a &str. Added .as_str() to convert the translated string for correct type usage and fix compilation error.
2025-12-23 14:27:38 +01:00
Sylvestre Ledru adafa2fdd9 tail: add debug info 2025-12-08 07:59:02 +01:00
oech3andGitHub 6e99389d0f Revert "ci: Mark runcon-no-reorder as SELinux required" (#9291) 2025-11-16 14:35:05 +01:00
EandGitHub 319c1e2dfa ci: Mark runcon-no-reorder as SELinux required 2025-11-12 13:37:47 +09:00
Sylvestre LedruandDaniel Hofstetter 23f3551e1c clap/locale: fix the colors for all programs (Closes: #8501)
Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
2025-09-05 08:25:59 +02:00
Sylvestre Ledru 2edfd85af7 mkdir: Replaced strict restorecon compatibility check with validation that mkdir -Z sets valid
SELinux contexts, since the Rust selinux crate may produce different but correct contexts
compared to native restorecon.
2025-07-14 21:26:00 +09:00
Sylvestre Ledru 576bd6f565 env: adjust to test after the improvement on the error message 2025-06-30 13:42:40 +02:00
Sudhakar VermaandGitHub c674cf1839 Merge pull request #8217 from sudhackar/ls-fix
ls: follow symlinks for xattrs, fix #8216
2025-06-19 10:17:25 +02:00
Ben Wiederhake 53836c9bd9 du: already passes GNU test in spirit, adjust test 2025-04-14 01:38:39 +02:00
Sylvestre Ledru 0b63fe5f43 gnu patches: move to use quilt 2025-01-22 11:25:58 +01:00
Daniel Hofstetter 98af681473 gnu patches: adapt tests_ls_no_cap.patch
to coreutils 9.6
2025-01-19 16:01:14 +01:00
Daniel Hofstetter e221d2a624 comm: adapt GNU error messages 2024-12-25 09:54:12 +01:00
Sylvestre Ledru ffc6eb094a ls: Don't call the capabilites features of the system when passed an empty ca=
in LS_COLORS

In parallel, in the GNU test, adjust the GNU tests as we don't use libcap
but xattr instead.
2024-12-22 16:17:05 +01:00
6755956bc4 cut.pl: adjust to our messages as they are better (#6921)
* cut.pl: adjust to our messages as they are better

but we still have some differences on this test

* cut: add some missing line return when needed

* cut: add failing tests covered by cut.pl

* Remove dup test

* cut: add spell-checker:ignore line to test

---------

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
2024-12-16 15:37:29 +01:00
Daniel Hofstetter a8ad6d92f1 factor: adapt message in patch to clap change 2024-12-15 16:34:20 +01:00
Sylvestre Ledru 7ffe3d49ef mv: fix the output of an error message
+ adjust a GNU test

Should make tests/mv/dup-source.sh pass
2024-11-20 08:03:40 -05:00
Sylvestre Ledru 5baf675b34 tsort.pl: adjust error message 2024-10-17 00:27:52 +02:00
Sylvestre Ledru 001b97f445 adjust error for runcon & stdbuf to make tests/misc/invalid-opt.pl pass 2024-08-20 22:28:16 +02:00