aboutsummaryrefslogtreecommitdiff
path: root/tests/builtin/timeout.testscript
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2020-10-14 16:15:41 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2020-11-06 10:47:57 +0300
commit3ee9761b73aff34c7f30ee44b8aac276d413cc21 (patch)
tree8720a9282eb9cb9ea211c8fa0487724615b513c2 /tests/builtin/timeout.testscript
parente197ae6fae73719266fd4747f499cd6106fbff4e (diff)
Add builtin::timed_wait(), builtin::try_wait(), and pseudo_builtin()
Diffstat (limited to 'tests/builtin/timeout.testscript')
-rw-r--r--tests/builtin/timeout.testscript30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/builtin/timeout.testscript b/tests/builtin/timeout.testscript
new file mode 100644
index 0000000..de81c6c
--- /dev/null
+++ b/tests/builtin/timeout.testscript
@@ -0,0 +1,30 @@
+# file : tests/builtin/timeout.testscript
+# license : MIT; see accompanying LICENSE file
+
+: async-builtin
+:
+{
+ : expired
+ :
+ $* -s 3 'cat' <'test' | $* -t 1 'cat' >=f 2>'timeout expired' != 0
+
+ : not-expired
+ :
+ echo 'test' | $* -t 10000 'cat' >!
+}
+
+: pseudo-builtin
+:
+{
+ : expired
+ :
+ $* -s 3 'cat' <'test' | $* -t 1 'roundtrip' >=f 2>'timeout expired' != 0
+
+ : not-expired
+ :
+ echo 'test' | $* -t 10000 'roundtrip' >!
+}
+
+: sync-builtin
+:
+$* -t 1 'mkdir' d &d/