mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
mktemp: add tests UNIX and POSIX to check path in prefix
This commit is contained in:
parent
5c3bb90df2
commit
9b4fb0cb6e
1 changed files with 20 additions and 0 deletions
|
@ -578,6 +578,26 @@ fn test_prefix_template_separator() {
|
||||||
new_ucmd!().args(&["-t", TEST_TEMPLATE9]).succeeds();
|
new_ucmd!().args(&["-t", TEST_TEMPLATE9]).succeeds();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_prefix_template_with_path_separator() {
|
||||||
|
#[cfg(not(windows))]
|
||||||
|
new_ucmd!()
|
||||||
|
.args(&["-t", "a/XXX"])
|
||||||
|
.fails()
|
||||||
|
.stderr_only(format!(
|
||||||
|
"mktemp: invalid template, {}, contains directory separator\n",
|
||||||
|
"a/XXX".quote()
|
||||||
|
));
|
||||||
|
#[cfg(windows)]
|
||||||
|
new_ucmd!()
|
||||||
|
.args(&["-t", r"a\XXX"])
|
||||||
|
.fails()
|
||||||
|
.stderr_only(format!(
|
||||||
|
"mktemp: invalid template, {}, contains directory separator\n",
|
||||||
|
r"a\XXX".quote()
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
/// Test that a suffix with a path separator is invalid.
|
/// Test that a suffix with a path separator is invalid.
|
||||||
#[test]
|
#[test]
|
||||||
fn test_suffix_path_separator() {
|
fn test_suffix_path_separator() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue