diff options
author | Oliver Kiddle <opk@users.sourceforge.net> | 2003-03-26 17:33:04 +0000 |
---|---|---|
committer | Oliver Kiddle <opk@users.sourceforge.net> | 2003-03-26 17:33:04 +0000 |
commit | 244f2a14fc2c0b9a57d782a290d17bc1a4299600 (patch) | |
tree | b0292bfde2229c0f95d5bb319290974adba0e9f1 /Test/B04read.ztst | |
parent | a9293199ec03d0a941504b06b3f4f07d97626fef (diff) | |
download | zsh-244f2a14fc2c0b9a57d782a290d17bc1a4299600.tar.gz zsh-244f2a14fc2c0b9a57d782a290d17bc1a4299600.tar.xz zsh-244f2a14fc2c0b9a57d782a290d17bc1a4299600.zip |
18391: add tests for read builtin a few glob qualifiers, 17678 and 18015
Diffstat (limited to 'Test/B04read.ztst')
-rw-r--r-- | Test/B04read.ztst | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/Test/B04read.ztst b/Test/B04read.ztst new file mode 100644 index 000000000..45a3486af --- /dev/null +++ b/Test/B04read.ztst @@ -0,0 +1,65 @@ +# Tests for the read builtin + +# Tested elsewhere: +# reading from a coprocess A01grammar, A04redirect + +# Not tested: +# -c/-l/-n (options for compctl functions) +# -q/-s (needs a tty) + +%test + + read <<<'hello world' + print $REPLY +0:basic read command +>hello world + + read -A <<<'hello world' + print $reply[2] +0:array read +>world + + read -k3 -u0 <<<foo:bar + print $REPLY +0:read specified number of chars +>foo + + read -d: <<<foo:bar + print $REPLY +0:read up to delimiter +>foo + + print foo:bar|IFS=: read -A + print $reply +0:use different, IFS separator to array +>foo bar + + print -z hello world; read -z + print $REPLY +0:read from editor buffer stack +>hello world + + unset REPLY + read -E <<<hello + print $REPLY +0:read with echoing and assigning +>hello +>hello + + unset REPLY + read -e <<<hello + print $REPLY +0:read with echoing but assigning disabled +>hello +> + + read -e -t <<<hello +0:read with test first +>hello + + SECONDS=0 + read -e -t 5 <<<hello + print $SECONDS +0:read with timeout (no waiting should occur) +>hello +>0 |