Skip to content

fix(pr): error messages to align with gnu#13231

Closed
HackingRepo wants to merge 6 commits into
uutils:mainfrom
HackingRepo:patch-9
Closed

fix(pr): error messages to align with gnu#13231
HackingRepo wants to merge 6 commits into
uutils:mainfrom
HackingRepo:patch-9

Conversation

@HackingRepo

Copy link
Copy Markdown
Contributor

Fixes #13013

Add test for file not found error message in test_pr.rs
Comment thread src/uu/pr/src/pr.rs Outdated
@HackingRepo
HackingRepo requested a review from oech3 June 30, 2026 11:33
@HackingRepo

Copy link
Copy Markdown
Contributor Author

oh one test is failing

[34](https://github.com/uutils/coreutils/actions/runs/28441034874/job/84278985695?pr=13231#step:8:4735)
failures:

---- test_pr::test_file_not_found_error_message stdout ----
bin: "D:\\a\\coreutils\\coreutils\\target\\debug\\coreutils.exe"
run: D:\a\coreutils\coreutils\target\debug\coreutils.exe pr aha

thread 'test_pr::test_file_not_found_error_message' (9160) panicked at tests\by-util\test_pr.rs:1028:10:
assertion failed: `(left == right)`

Diff < left / right > :
<pr: aha: The system cannot find the file specified.
>pr: aha: No such file or directory
 


stack backtrace:
   0: std::panicking::panic_handler
             at /rustc/ac68faa20c58cbccd01ee7208bf3b6e93a7d7f96/library\std\src\panicking.rs:689
   1: core::panicking::panic_fmt
             at /rustc/ac68faa20c58cbccd01ee7208bf3b6e93a7d7f96/library\core\src\panicking.rs:80
   2: uutests::util::CmdResult::stderr_is<ref$<str$> >
             at .\tests\uutests\src\lib\util.rs:647
   3: tests::test_pr::test_file_not_found_error_message
             at .\tests\by-util\test_pr.rs:1028
   4: tests::test_pr::test_file_not_found_error_message::closure$0
             at .\tests\by-util\test_pr.rs:1024
   5: core::ops::function::FnOnce::call_once<tests::test_pr::test_file_not_found_error_message::closure_env$0,tuple$<> >
             at /rustc/ac68faa20c58cbccd01ee7208bf3b6e93a7d7f96/library\core\src\ops\function.rs:250
   6: core::ops::function::FnOnce::call_once
             at /rustc/ac68faa20c58cbccd01ee7208bf3b6e93a7d7f96/library\core\src\ops\function.rs:250
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

@github-actions

Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/date/date-locale-hour (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/tail/tail-n0f (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/misc/io-errors (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/tail/inotify-dir-recreate (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/cut/cut-huge-range is now passing!

@HackingRepo

Copy link
Copy Markdown
Contributor Author

ok the issue with windows, linux and unix tests passing only windows tests failing

Comment thread src/uu/pr/src/pr.rs Outdated
HackingRepo and others added 2 commits July 2, 2026 15:08
Co-authored-by: xtqqczze <45661989+xtqqczze@users.noreply.github.com>
@HackingRepo

Copy link
Copy Markdown
Contributor Author

the one failing job gnu tests just about network issues

curl: (56) Recv failure: Connection reset by peer

and unrelated to the pr

Comment thread src/uu/pr/src/pr.rs

// New variant that correctly formats the file path error like GNU pr
#[error("pr: {path}: {msg}")]
Path { path: String, msg: String },

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.

I’d prefer to preserve the original types here rather than converting them eagerly. Something like:

Suggested change
Path { path: String, msg: String },
Path { path: Path, msg: io:Error },

and then perform the formatting in the #[error] attribute

Comment thread src/uu/pr/src/pr.rs Outdated
@cakebaker

Copy link
Copy Markdown
Contributor

Superceded by #13534 . Anyway, thanks for the PR!

@cakebaker cakebaker closed this Jul 23, 2026
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.

pr: bad error message when directory doesn't exist

4 participants