mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
tests/expr: test escape
This commit is contained in:
parent
62eb5a434d
commit
5b1755387f
1 changed files with 25 additions and 0 deletions
|
@ -138,6 +138,11 @@ fn test_or() {
|
|||
.args(&["0", "|", "10", "/", "5"])
|
||||
.succeeds()
|
||||
.stdout_only("2\n");
|
||||
|
||||
new_ucmd!()
|
||||
.args(&["12", "|", "9a", "+", "1"])
|
||||
.succeeds()
|
||||
.stdout_only("12\n");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
@ -275,3 +280,23 @@ fn test_invalid_substr() {
|
|||
.code_is(1)
|
||||
.stdout_only("\n");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_escape() {
|
||||
new_ucmd!().args(&["+", "1"]).succeeds().stdout_only("1\n");
|
||||
|
||||
new_ucmd!()
|
||||
.args(&["1", "+", "+", "1"])
|
||||
.succeeds()
|
||||
.stdout_only("2\n");
|
||||
|
||||
new_ucmd!()
|
||||
.args(&["2", "*", "+", "3"])
|
||||
.succeeds()
|
||||
.stdout_only("6\n");
|
||||
|
||||
new_ucmd!()
|
||||
.args(&["(", "1", ")", "+", "1"])
|
||||
.succeeds()
|
||||
.stdout_only("2\n");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue