# 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 read -d: <<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 >hello unset REPLY read -e <<hello > read -e -t <<hello SECONDS=0 read -e -t 5 <<hello >0