1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-09-16 03:36:18 +00:00

Merge pull request #3573 from jfinkels/mktemp-simpler-prefix-suffix

mktemp: simplify file path parameter logic
This commit is contained in:
Sylvestre Ledru 2022-06-01 08:38:31 +01:00 committed by GitHub
commit 2ed64fc9a1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 230 additions and 176 deletions

View file

@ -519,6 +519,7 @@ fn test_directory_permissions() {
/// Test that a template with a path separator is invalid.
#[test]
fn test_template_path_separator() {
#[cfg(not(windows))]
new_ucmd!()
.args(&["-t", "a/bXXX"])
.fails()
@ -526,6 +527,14 @@ fn test_template_path_separator() {
"mktemp: invalid template, {}, contains directory separator\n",
"a/bXXX".quote()
));
#[cfg(windows)]
new_ucmd!()
.args(&["-t", r"a\bXXX"])
.fails()
.stderr_only(format!(
"mktemp: invalid template, {}, contains directory separator\n",
r"a\bXXX".quote()
));
}
/// Test that a suffix with a path separator is invalid.