mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-27 11:07:44 +00:00
Merge pull request #5405 from cakebaker/expr_test_invalid_syntaxes
expr: test some invalid syntaxes
This commit is contained in:
commit
c6b14735f6
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