mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
mktemp: respect POSIXLY_CORRECT env var when parsing args
Signed-off-by: Junji Wei <harukawei99@gmail.com>
This commit is contained in:
parent
702a0b7a34
commit
1ba0bfc67a
2 changed files with 45 additions and 2 deletions
|
@ -641,3 +641,25 @@ fn test_suffix_empty_template() {
|
|||
.fails()
|
||||
.stderr_is("mktemp: with --suffix, template '' must end in X\n");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_mktemp_with_posixly_correct() {
|
||||
let scene = TestScenario::new(util_name!());
|
||||
|
||||
scene
|
||||
.ucmd()
|
||||
.env("POSIXLY_CORRECT", "1")
|
||||
.args(&["aXXXX", "--suffix=b"])
|
||||
.fails()
|
||||
.stderr_is(&format!(
|
||||
"mktemp: too many templates\nTry '{} {} --help' for more information.\n",
|
||||
scene.bin_path.to_string_lossy(),
|
||||
scene.util_name
|
||||
));
|
||||
|
||||
scene
|
||||
.ucmd()
|
||||
.env("POSIXLY_CORRECT", "1")
|
||||
.args(&["--suffix=b", "aXXXX"])
|
||||
.succeeds();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue