mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
mktemp: adjust the error message to match 9.5
This commit is contained in:
@@ -236,8 +236,13 @@ impl Params {
|
||||
let (i, j) = match find_last_contiguous_block_of_xs(&options.template) {
|
||||
None => {
|
||||
let s = match options.suffix {
|
||||
// If a suffix is specified, the error message includes the template without the suffix.
|
||||
Some(_) => options
|
||||
.template
|
||||
.chars()
|
||||
.take(options.template.len())
|
||||
.collect::<String>(),
|
||||
None => options.template,
|
||||
Some(s) => format!("{}{}", options.template, s),
|
||||
};
|
||||
return Err(MkTempError::TooFewXs(s));
|
||||
}
|
||||
|
||||
@@ -629,7 +629,7 @@ fn test_too_few_xs_suffix() {
|
||||
new_ucmd!()
|
||||
.args(&["--suffix=X", "aXX"])
|
||||
.fails()
|
||||
.stderr_only("mktemp: too few X's in template 'aXXX'\n");
|
||||
.stderr_only("mktemp: too few X's in template 'aXX'\n");
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -637,7 +637,7 @@ fn test_too_few_xs_suffix_directory() {
|
||||
new_ucmd!()
|
||||
.args(&["-d", "--suffix=X", "aXX"])
|
||||
.fails()
|
||||
.stderr_only("mktemp: too few X's in template 'aXXX'\n");
|
||||
.stderr_only("mktemp: too few X's in template 'aXX'\n");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user