1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-09-15 11:36:16 +00:00

Merge pull request #5365 from Luv-Ray/fix-expr

`expr`: short-circuit evaluation for `|`
This commit is contained in:
Daniel Hofstetter 2023-10-08 14:55:59 +02:00 committed by GitHub
commit 94f5fa9487
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 34 additions and 2 deletions

View file

@ -123,6 +123,21 @@ fn test_or() {
.args(&["-14", "|", "1"])
.succeeds()
.stdout_only("-14\n");
new_ucmd!()
.args(&["1", "|", "a", "/", "5"])
.succeeds()
.stdout_only("1\n");
new_ucmd!()
.args(&["foo", "|", "a", "/", "5"])
.succeeds()
.stdout_only("foo\n");
new_ucmd!()
.args(&["0", "|", "10", "/", "5"])
.succeeds()
.stdout_only("2\n");
}
#[test]