summary refs log tree commit diff
path: root/bin/cash/tests/builtins/read1.0
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-01-10 18:48:02 -0500
committerJune McEnroe <june@causal.agency>2019-01-10 18:48:02 -0500
commit308a14f85158f1545000499a64bc170d688a0db9 (patch)
treedfba0e2c80cbde1c38c814a4c84ce4d2c6d9c09f /bin/cash/tests/builtins/read1.0
parentRemove character NETHACKOPTIONS (diff)
downloadsrc-308a14f85158f1545000499a64bc170d688a0db9.tar.gz
src-308a14f85158f1545000499a64bc170d688a0db9.zip
Import /usr/src/bin/sh from FreeBSD 12.0-RELEASE
Diffstat (limited to '')
-rw-r--r--bin/cash/tests/builtins/read1.026
-rw-r--r--bin/cash/tests/builtins/read1.0.stdout20
2 files changed, 46 insertions, 0 deletions
diff --git a/bin/cash/tests/builtins/read1.0 b/bin/cash/tests/builtins/read1.0
new file mode 100644
index 00000000..753613d0
--- /dev/null
+++ b/bin/cash/tests/builtins/read1.0
@@ -0,0 +1,26 @@
+# $FreeBSD: releng/12.0/bin/sh/tests/builtins/read1.0 190300 2009-03-22 23:00:52Z stefanf $
+set -e
+
+echo "1 2 3"		| { read a; echo "x${a}x"; }
+echo "1 2 3"		| { read a b; echo "x${a}x${b}x"; }
+echo "1 2 3"		| { read a b c; echo "x${a}x${b}x${c}x"; }
+echo "1 2 3"		| { read a b c d; echo "x${a}x${b}x${c}x${d}x"; }
+
+echo "	1  2 3 "	| { read a b c; echo "x${a}x${b}x${c}x"; }
+echo "	1  2 3 "	| { unset IFS; read a b c; echo "x${a}x${b}x${c}x"; }
+echo "	1  2 3 "	| { IFS=$(printf ' \t\n') read a b c; echo "x${a}x${b}x${c}x"; }
+echo "	1  2 3 "	| { IFS= read a b; echo "x${a}x${b}x"; }
+
+echo " 1,2 3 "		| { IFS=' ,' read a b c; echo "x${a}x${b}x${c}x"; }
+echo ", 2 ,3"		| { IFS=' ,' read a b c; echo "x${a}x${b}x${c}x"; }
+echo " 1 ,,3"		| { IFS=' ,' read a b c; echo "x${a}x${b}x${c}x"; }
+echo " 1 , , 3"		| { IFS=' ,' read a b c; echo "x${a}x${b}x${c}x"; }
+echo " 1 ,2 3,"		| { IFS=' ,' read a b c; echo "x${a}x${b}x${c}x"; }
+echo " 1 ,2 3,,"	| { IFS=' ,' read a b c; echo "x${a}x${b}x${c}x"; }
+
+echo " 1,2 3 "		| { IFS=', ' read a b c; echo "x${a}x${b}x${c}x"; }
+echo ", 2 ,3"		| { IFS=', ' read a b c; echo "x${a}x${b}x${c}x"; }
+echo " 1 ,,3"		| { IFS=', ' read a b c; echo "x${a}x${b}x${c}x"; }
+echo " 1 , , 3"		| { IFS=', ' read a b c; echo "x${a}x${b}x${c}x"; }
+echo " 1 ,2 3,"		| { IFS=', ' read a b c; echo "x${a}x${b}x${c}x"; }
+echo " 1 ,2 3,,"	| { IFS=', ' read a b c; echo "x${a}x${b}x${c}x"; }
diff --git a/bin/cash/tests/builtins/read1.0.stdout b/bin/cash/tests/builtins/read1.0.stdout
new file mode 100644
index 00000000..dbcb1af9
--- /dev/null
+++ b/bin/cash/tests/builtins/read1.0.stdout
@@ -0,0 +1,20 @@
+x1 2 3x
+x1x2 3x
+x1x2x3x
+x1x2x3xx
+x1x2x3x
+x1x2x3x
+x1x2x3x
+x	1  2 3 xx
+x1x2x3x
+xx2x3x
+x1xx3x
+x1xx3x
+x1x2x3x
+x1x2x3,,x
+x1x2x3x
+xx2x3x
+x1xx3x
+x1xx3x
+x1x2x3x
+x1x2x3,,x
it/bin/git-comment.pl?id=8e569858ece13fedeeae88645a9e5776c28bedc4&follow=1'>Defer printing comment if line is blank or closing braceJune McEnroe 2021-09-08Up default min-repeat to 30 linesJune McEnroe 2021-09-08Handle dirty lines in git-commentJune McEnroe 2021-09-08Document and install git-commentJune McEnroe 2021-09-08Add repeat and all options to git-commentJune McEnroe 2021-09-08Add group threshold to git-commentJune McEnroe