diff options
Diffstat (limited to 'tests/test/script/builtin/test.test')
-rw-r--r-- | tests/test/script/builtin/test.test | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/tests/test/script/builtin/test.test b/tests/test/script/builtin/test.test index 7e9ace4..2e792ad 100644 --- a/tests/test/script/builtin/test.test +++ b/tests/test/script/builtin/test.test @@ -9,21 +9,18 @@ { : exists : - $c <<EOI; + $c <<EOI && $b touch a; test -f a EOI - $b : not-exists : - $c <'test -f a == 1'; - $b + $c <'test -f a == 1' && $b : not-file : - $c <'test -f . == 1'; - $b + $c <'test -f . == 1' && $b } : dir @@ -31,49 +28,42 @@ { : exists : - $c <'test -d .'; - $b + $c <'test -d .' && $b : not-exists : - $c <'test -d a == 1'; - $b + $c <'test -d a == 1' && $b : not-dir : - $c <<EOI; + $c <<EOI && $b touch a; test -d a == 1 EOI - $b } : no-args : : Test passing no arguments. : -$c <'test 2>"test: missing path" == 2'; -$b +$c <'test 2>"test: missing path" == 2' && $b : invalid-option : : Test passing invalid option. : -$c <'test -c a 2>"test: invalid option" == 2'; -$b +$c <'test -c a 2>"test: invalid option" == 2' && $b : unexpected-arg : : Test passing extra argument. : -$c <'test -f a b 2>"test: unexpected argument" == 2'; -$b +$c <'test -f a b 2>"test: unexpected argument" == 2' && $b : empty-path : : Test testing an empty path. : -$c <<EOI; +$c <<EOI && $b test -d '' 2>"test: invalid path ''" == 2 EOI -$b |