From 3ee9761b73aff34c7f30ee44b8aac276d413cc21 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 14 Oct 2020 16:15:41 +0300 Subject: Add builtin::timed_wait(), builtin::try_wait(), and pseudo_builtin() --- tests/builtin/timeout.testscript | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 tests/builtin/timeout.testscript (limited to 'tests/builtin/timeout.testscript') 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/ -- cgit v1.1