aboutsummaryrefslogtreecommitdiff
path: root/tests/test/script/builtin/test.testscript
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2019-07-22 22:37:40 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2019-07-24 21:37:58 +0300
commit72945d9c8eee18aed1550c3f42dc41e6a8a0f029 (patch)
tree9fdfe1c3bf48d0e303dc435c40116dacf48286b3 /tests/test/script/builtin/test.testscript
parent83bb02cada0b894d9134cc5489999e0f0fe8bd7c (diff)
Use CLI-generated classes to parse testscript builtin options
Diffstat (limited to 'tests/test/script/builtin/test.testscript')
-rw-r--r--tests/test/script/builtin/test.testscript58
1 files changed, 36 insertions, 22 deletions
diff --git a/tests/test/script/builtin/test.testscript b/tests/test/script/builtin/test.testscript
index 650f9ef..dceb229 100644
--- a/tests/test/script/builtin/test.testscript
+++ b/tests/test/script/builtin/test.testscript
@@ -42,30 +42,44 @@
EOI
}
-: no-args
+: options
:
-: Test passing no arguments.
-:
-$c <'test 2>"test: missing path" == 2' && $b
+{
+ : unknown
+ :
+ $c <<EOI && $b
+ test -u 2>"test: unknown option '-u'" == 2
+ EOI
-: invalid-option
-:
-: Test passing invalid option.
-:
-$c <'test -c a 2>"test: invalid option" == 2' && $b
+ : none
+ :
+ $c <<EOI && $b
+ test 2>"test: either -f|--file or -d|--directory must be specified" == 2
+ EOI
-: unexpected-arg
-:
-: Test passing extra argument.
-:
-$c <<EOI && $b
-test -f a b 2>"test: unexpected argument 'b'" == 2
-EOI
+ : both-file-dir
+ :
+ $c <<EOI && $b
+ test -f -d 2>"test: both -f|--file and -d|--directory specified" == 2
+ EOI
+}
-: empty-path
+: args
:
-: Test testing an empty path.
-:
-$c <<EOI && $b
-test -d '' 2>"test: invalid path ''" == 2
-EOI
+{
+ : none
+ :
+ $c <'test -f 2>"test: missing path" == 2' && $b
+
+ : unexpected
+ :
+ $c <<EOI && $b
+ test -f a b 2>"test: unexpected argument 'b'" == 2
+ EOI
+
+ : empty-path
+ :
+ $c <<EOI && $b
+ test -d '' 2>"test: invalid path ''" == 2
+ EOI
+}