1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

ls: forgot to push updated tests

This commit is contained in:
Terts Diepraam 2021-04-03 13:15:19 +02:00
parent 06bdc144d7
commit 9cb0fc2945

View file

@ -1142,9 +1142,9 @@ fn test_ls_quoting_style() {
assert_eq!(result.stdout, "'one'$'\\n''two'\n"); assert_eq!(result.stdout, "'one'$'\\n''two'\n");
for (arg, correct) in &[ for (arg, correct) in &[
("--quoting-style=literal", "one\ntwo"), ("--quoting-style=literal", "one?two"),
("-N", "one\ntwo"), ("-N", "one?two"),
("--literal", "one\ntwo"), ("--literal", "one?two"),
("--quoting-style=c", "\"one\\ntwo\""), ("--quoting-style=c", "\"one\\ntwo\""),
("-Q", "\"one\\ntwo\""), ("-Q", "\"one\\ntwo\""),
("--quote-name", "\"one\\ntwo\""), ("--quote-name", "\"one\\ntwo\""),
@ -1161,6 +1161,24 @@ fn test_ls_quoting_style() {
println!("stdout = {:?}", result.stdout); println!("stdout = {:?}", result.stdout);
assert_eq!(result.stdout, format!("{}\n", correct)); assert_eq!(result.stdout, format!("{}\n", correct));
} }
for (arg, correct) in &[
("--quoting-style=literal", "one\ntwo"),
("-N", "one\ntwo"),
("--literal", "one\ntwo"),
("--quoting-style=shell", "one\ntwo"),
("--quoting-style=shell-always", "'one\ntwo'"),
] {
let result = scene
.ucmd()
.arg(arg)
.arg("--show-control-chars")
.arg("one\ntwo")
.run();
println!("stderr = {:?}", result.stderr);
println!("stdout = {:?}", result.stdout);
assert_eq!(result.stdout, format!("{}\n", correct));
}
} }
let result = scene.ucmd().arg("one two").succeeds(); let result = scene.ucmd().arg("one two").succeeds();