mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
parent
165bbc272a
commit
a8b9e042e1
2 changed files with 30 additions and 18 deletions
|
@ -1456,15 +1456,37 @@ fn test_unescaped_backslash_warning_false_positive() {
|
|||
.pipe_in(r"a\b\c\")
|
||||
.succeeds()
|
||||
.stdout_only("abc");
|
||||
new_ucmd!()
|
||||
.args(&["-d", r"\\\\"])
|
||||
.pipe_in(r"a\b\c\")
|
||||
.succeeds()
|
||||
.stdout_only("abc");
|
||||
new_ucmd!()
|
||||
.args(&["-d", r"\\\\\\"])
|
||||
.pipe_in(r"a\b\c\")
|
||||
.succeeds()
|
||||
.stdout_only("abc");
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(unix)]
|
||||
fn test_trailing_backslash_is_only_input_character() {
|
||||
fn test_trailing_backslash() {
|
||||
new_ucmd!()
|
||||
.args(&["-d", r"\"])
|
||||
.pipe_in(r"a\b\c\")
|
||||
.succeeds()
|
||||
.stderr_is("tr: warning: an unescaped backslash at end of string is not portable\n")
|
||||
.stdout_is("abc");
|
||||
new_ucmd!()
|
||||
.args(&["-d", r"\\\"])
|
||||
.pipe_in(r"a\b\c\")
|
||||
.succeeds()
|
||||
.stderr_is("tr: warning: an unescaped backslash at end of string is not portable\n")
|
||||
.stdout_is("abc");
|
||||
new_ucmd!()
|
||||
.args(&["-d", r"\\\\\"])
|
||||
.pipe_in(r"a\b\c\")
|
||||
.succeeds()
|
||||
.stderr_is("tr: warning: an unescaped backslash at end of string is not portable\n")
|
||||
.stdout_is("abc");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue