aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/read.in
diff options
context:
space:
mode:
Diffstat (limited to 'tests/read.in')
-rw-r--r--tests/read.in25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/read.in b/tests/read.in
index f864287f..7cf09112 100644
--- a/tests/read.in
+++ b/tests/read.in
@@ -1,3 +1,4 @@
+# vim: set filetype=fish:
#
# Test read builtin and IFS
#
@@ -35,6 +36,8 @@ echo '' | read -l one two
print_vars one two
echo 'test' | read -l one two three
print_vars one two three
+echo 'foo bar baz' | read -l one two three
+print_vars one two three
echo
set -l IFS
@@ -91,3 +94,25 @@ echo $foo
echo $bar
echo 'test' | read -n 1 foo
echo $foo
+
+# read -0 tests
+
+echo
+echo '# read -z tests'
+echo -n 'testing' | read -lz foo
+echo $foo
+echo -n 'test ing' | read -lz foo
+echo $foo
+echo 'newline' | read -lz foo
+echo $foo
+echo -n 'test ing' | read -lz foo bar
+print_vars foo bar
+echo -ne 'test\0ing' | read -lz foo bar
+print_vars foo bar
+echo -ne 'foo\nbar' | read -lz foo bar
+print_vars foo bar
+echo -ne 'foo\nbar\0baz\nquux' | while read -lza foo
+ print_vars foo
+end
+
+true