aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/read.in
diff options
context:
space:
mode:
Diffstat (limited to 'tests/read.in')
-rw-r--r--tests/read.in16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/read.in b/tests/read.in
index f8787c5c..f864287f 100644
--- a/tests/read.in
+++ b/tests/read.in
@@ -75,3 +75,19 @@ print_vars ary
echo '' | read -la ary
print_vars ary
set -le IFS
+
+# read -n tests
+
+echo
+echo '# read -n tests'
+echo 'testing' | read -n 3 foo
+echo $foo
+echo 'test' | read -n 10 foo
+echo $foo
+echo 'test' | read -n 0 foo
+echo $foo
+echo 'testing' | begin; read -n 3 foo; read -n 3 bar; end
+echo $foo
+echo $bar
+echo 'test' | read -n 1 foo
+echo $foo