summaryrefslogtreecommitdiffstats
path: root/tests/test/script/builtin
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test/script/builtin')
-rw-r--r--tests/test/script/builtin/sed.testscript2
-rw-r--r--tests/test/script/builtin/sleep.testscript31
-rw-r--r--tests/test/script/builtin/test.testscript4
3 files changed, 35 insertions, 2 deletions
diff --git a/tests/test/script/builtin/sed.testscript b/tests/test/script/builtin/sed.testscript
index 1665de2b..e3c0965d 100644
--- a/tests/test/script/builtin/sed.testscript
+++ b/tests/test/script/builtin/sed.testscript
@@ -109,7 +109,7 @@
$c <"sed -e 's/a//' a b" && $b 2>>/EOE != 0
testscript:1:1: error: sed exit code 1 != 0
info: stderr: test/1/stderr
- sed: unexpected argument
+ sed: unexpected argument 'b'
info: test id: 1
EOE
}
diff --git a/tests/test/script/builtin/sleep.testscript b/tests/test/script/builtin/sleep.testscript
new file mode 100644
index 00000000..c43418d4
--- /dev/null
+++ b/tests/test/script/builtin/sleep.testscript
@@ -0,0 +1,31 @@
+# file : tests/test/script/builtin/sleep.testscript
+# copyright : Copyright (c) 2014-2019 Code Synthesis Ltd
+# license : MIT; see accompanying LICENSE file
+
+.include ../common.testscript
+
+: success
+:
+$c <'sleep 1' && $b
+
+: no-time
+:
+: Test passing no time interval.
+:
+$c <'sleep 2>"sleep: missing time interval" != 0' && $b
+
+: invalid-time
+:
+: Test passing invalid time interval.
+:
+$c <<EOI && $b
+sleep 1a 2>"sleep: invalid time interval '1a'" != 0
+EOI
+
+: unexpected-arg
+:
+: Test passing extra argument.
+:
+$c <<EOI && $b
+sleep 1 1 2>"sleep: unexpected argument '1'" != 0
+EOI
diff --git a/tests/test/script/builtin/test.testscript b/tests/test/script/builtin/test.testscript
index c17b3b0b..650f9ef7 100644
--- a/tests/test/script/builtin/test.testscript
+++ b/tests/test/script/builtin/test.testscript
@@ -58,7 +58,9 @@ $c <'test -c a 2>"test: invalid option" == 2' && $b
:
: Test passing extra argument.
:
-$c <'test -f a b 2>"test: unexpected argument" == 2' && $b
+$c <<EOI && $b
+test -f a b 2>"test: unexpected argument 'b'" == 2
+EOI
: empty-path
: