mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-27 19:17:43 +00:00
expr: test some invalid syntaxes
This commit is contained in:
parent
62eb5a434d
commit
f6880bff8f
1 changed files with 13 additions and 0 deletions
|
@ -275,3 +275,16 @@ fn test_invalid_substr() {
|
||||||
.code_is(1)
|
.code_is(1)
|
||||||
.stdout_only("\n");
|
.stdout_only("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_invalid_syntax() {
|
||||||
|
let invalid_syntaxes = [["12", "12"], ["12", "|"], ["|", "12"]];
|
||||||
|
|
||||||
|
for invalid_syntax in invalid_syntaxes {
|
||||||
|
new_ucmd!()
|
||||||
|
.args(&invalid_syntax)
|
||||||
|
.fails()
|
||||||
|
.code_is(2)
|
||||||
|
.stderr_contains("syntax error");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue