Repository navigation
Conversation
|
GNU testsuite comparison: |
|
well, |
|
read-only fs error would contain an os error too, we can just check if it doesnt |
Merging this PR will degrade performance by 3.17%
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing Footnotes
|
| mktemp-error-too-many-templates = too many templates | ||
| mktemp-error-not-found = failed to create { $template_type } via template { $template }: No such file or directory | ||
| mktemp-error-failed-print = failed to print directory name | ||
| mktemp-error-failed-to-create-file-via-template = failed to create file via template '{ $path }': { $error } |
There was a problem hiding this comment.
please use .quote() on the path instead of hardcoded quotes
| Err(MkTempError::NotFound(translate!("mktemp-template-type-file"), path).into()) | ||
| } | ||
| Err(e) => Err(e.into()), | ||
| Err(e) => { |
There was a problem hiding this comment.
what about make_temp_dir? mktemp -d -p /ro will still show the os error
There was a problem hiding this comment.
Yeah, I'll even add this to the test
| } | ||
| Err(e) => Err(e.into()), | ||
| Err(e) => { | ||
| let filename = format!("{prefix}{}{suffix}", "X".repeat(rand)); |
There was a problem hiding this comment.
same two lines as the NotFound arm just above, could be dedup, no?
| Err(e) => { | ||
| let filename = format!("{prefix}{}{suffix}", "X".repeat(rand)); | ||
| let path = Path::new(dir).join(filename); | ||
| Err(uucore::error::USimpleError::new( |
There was a problem hiding this comment.
please add a variant to MkTempError instead of a USimpleError, like NotFound
| fn test_permission_denied_no_os_error() { | ||
| let scene = TestScenario::new(util_name!()); | ||
|
|
||
| let result = scene.ucmd().arg("-p").arg("/").run(); |
There was a problem hiding this comment.
as root this passes the permission check and creates a file in /
please create a dir with no write permission in the fixture instead
|
|
||
| assert!(!result.succeeded()); | ||
|
|
||
| assert!(!result.stderr_str().contains("os error")); |
There was a problem hiding this comment.
please check the full message with stderr_is / stderr_contains("Permission denied")
fc5b6a4 to
44e4cf4
Compare
44e4cf4 to
114f87e
Compare
|
Locales do use |
closes #13720, pr #13815 seems to be abondoned