diff options
author | Jason Downs <downsj@cvs.openbsd.org> | 1996-08-14 08:05:27 +0000 |
---|---|---|
committer | Jason Downs <downsj@cvs.openbsd.org> | 1996-08-14 08:05:27 +0000 |
commit | c66bb679d79d844029859810085e570f4f4d67ee (patch) | |
tree | f94e76262c4e3ac77eb927b67f21b198a4ec95e4 /bin/ksh/tests/read.t | |
parent | 52a7e18144267fb93e80ff7051945e20832f5a67 (diff) |
Add these to the repository, but don't do anything with them; they
need perl (at least for now).
Diffstat (limited to 'bin/ksh/tests/read.t')
-rw-r--r-- | bin/ksh/tests/read.t | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/bin/ksh/tests/read.t b/bin/ksh/tests/read.t new file mode 100644 index 00000000000..aced86adc32 --- /dev/null +++ b/bin/ksh/tests/read.t @@ -0,0 +1,56 @@ +# +# To test: +# POSIX: +# - if no -r, \ is escape character +# - \newline disappear +# - \<IFS> -> don't break here +# - \<anything-else> -> <anything-else> +# - if -r, backslash is not special +# - if stdin is tty and shell interactive +# - prompt for continuation if \newline (prompt to stderr) +# - a here-document isn't terminated after newline ???? +# - remaining vars set to empty string (not null) +# - check field splitting +# - left over fields and their seperators assigned to last var +# - exit status is normally 0 +# - exit status is > 0 on eof +# - exit status > 0 on error +# - signals interrupt reads +# extra: +# - can't change read-only variables +# - error if var name bogus +# - set -o allexport effects read +# ksh: +# x check default variable: REPLY +# - check -p, -s, -u options +# - check var?prompt stuff +# - "echo a b | read x y" sets x,y in parent shell (at&t) +# +name: read-IFS-1 +description: + Simple test, default IFS +stdin: + echo "A B " > IN + unset x y z + read x y z < IN + echo 1: "x[$x] y[$y] z[$z]" + echo 1a: ${z-z not set} + read x < IN + echo 2: "x[$x]" +expected-stdout: + 1: x[A] y[B] z[] + 1a: + 2: x[A B] +--- + +name: read-ksh-1 +description: + If no var specified, REPLY is used +stdin: + echo "abc" > IN + read < IN + echo "[$REPLY]"; +expected-stdout: + [abc] +--- + |