aboutsummaryrefslogtreecommitdiff
path: root/tests/test/script/builtin/sleep.testscript
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2019-01-23 21:47:38 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2019-01-24 14:03:08 +0300
commitcc6280af7eca660c916dc652066216acd474979d (patch)
tree656eea184002c665ebb1c7385d1c560c2ea67249 /tests/test/script/builtin/sleep.testscript
parent1a30ba3788022d9cbee8cd13ae065f927817a08b (diff)
Add testscript sleep builtin
Diffstat (limited to 'tests/test/script/builtin/sleep.testscript')
-rw-r--r--tests/test/script/builtin/sleep.testscript31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/test/script/builtin/sleep.testscript b/tests/test/script/builtin/sleep.testscript
new file mode 100644
index 0000000..c43418d
--- /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