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

test: -o arg should trigger an error (#6642)

* test: -o arg should trigger an error

Should fix tests/test/test-diag.pl

* test: use var directly in string

---------

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
This commit is contained in:
Sylvestre Ledru 2024-08-13 11:05:35 +02:00 committed by GitHub
parent fa03b85a47
commit 6b70dc232e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 19 additions and 1 deletions

View file

@ -67,7 +67,7 @@ fn test_double_not_is_false() {
#[test]
fn test_and_not_is_false() {
new_ucmd!().args(&["-a", "!"]).run().code_is(1);
new_ucmd!().args(&["-a", "!"]).run().code_is(2);
}
#[test]
@ -86,6 +86,18 @@ fn test_simple_or() {
new_ucmd!().args(&["foo", "-o", ""]).succeeds();
}
#[test]
fn test_errors_miss_and_or() {
new_ucmd!()
.args(&["-o", "arg"])
.fails()
.stderr_contains("'-o': unary operator expected");
new_ucmd!()
.args(&["-a", "arg"])
.fails()
.stderr_contains("'-a': unary operator expected");
}
#[test]
fn test_negated_or() {
new_ucmd!()