diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2017-07-20 16:09:31 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2017-07-20 16:09:31 +0200 |
commit | eae12688c9bb056b21e4e62fc295be5ebdcb8b7b (patch) | |
tree | 785eeede5f3c288a510bbd74fe52e1c216155284 /shell/ash_test | |
parent | 82dcc3bff97b08db227610596a54574783f69631 (diff) | |
download | busybox-w32-eae12688c9bb056b21e4e62fc295be5ebdcb8b7b.tar.gz busybox-w32-eae12688c9bb056b21e4e62fc295be5ebdcb8b7b.tar.bz2 busybox-w32-eae12688c9bb056b21e4e62fc295be5ebdcb8b7b.zip |
shell: optional support for read -t N.NNN, closes 10101
function old new delta
shell_builtin_read 1097 1277 +180
dump_procs 353 359 +6
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/ash_test')
-rw-r--r-- | shell/ash_test/ash-read/read_t0.right | 3 | ||||
-rwxr-xr-x | shell/ash_test/ash-read/read_t0.tests | 14 |
2 files changed, 17 insertions, 0 deletions
diff --git a/shell/ash_test/ash-read/read_t0.right b/shell/ash_test/ash-read/read_t0.right new file mode 100644 index 000000000..f02105961 --- /dev/null +++ b/shell/ash_test/ash-read/read_t0.right | |||
@@ -0,0 +1,3 @@ | |||
1 | ><[0] | ||
2 | ><[0] | ||
3 | ><[1] | ||
diff --git a/shell/ash_test/ash-read/read_t0.tests b/shell/ash_test/ash-read/read_t0.tests new file mode 100755 index 000000000..6b7bc217b --- /dev/null +++ b/shell/ash_test/ash-read/read_t0.tests | |||
@@ -0,0 +1,14 @@ | |||
1 | # ><[0] | ||
2 | echo Ok | { sleep 0.1; read -t 0 reply; echo ">$reply<[$?]"; } | ||
3 | |||
4 | # This would not be deterministic: returns 0 "data exists" if EOF is seen | ||
5 | # (true terminated) - because EOF is considered to be data (read will not block), | ||
6 | # else returns 1 "no data". | ||
7 | ## ><[????] | ||
8 | #true | { read -t 0 reply; echo ">$reply<[$?]"; } | ||
9 | |||
10 | # ><[0] | ||
11 | true | { sleep 0.1; read -t 0 reply; echo ">$reply<[$?]"; } | ||
12 | |||
13 | # ><[1] | ||
14 | sleep 0.2 | { read -p IGNORED_PROMPT -t 0 reply; echo ">$reply<[$?]"; } | ||