aboutsummaryrefslogtreecommitdiff
path: root/tests/test/script/builtin/cat.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test/script/builtin/cat.test')
-rw-r--r--tests/test/script/builtin/cat.test31
1 files changed, 17 insertions, 14 deletions
diff --git a/tests/test/script/builtin/cat.test b/tests/test/script/builtin/cat.test
index 442ef00..33515bc 100644
--- a/tests/test/script/builtin/cat.test
+++ b/tests/test/script/builtin/cat.test
@@ -6,7 +6,7 @@
: in
:
-$c <<EOI;
+$c <<EOI && $b
cat <<EOF >>EOO
foo
bar
@@ -15,11 +15,10 @@ foo
bar
EOO
EOI
-$b
: dash
:
-$c <<EOI;
+$c <<EOI && $b
cat - <<EOF >>EOO
foo
bar
@@ -28,11 +27,10 @@ foo
bar
EOO
EOI
-$b
: file
:
-$c <<EOI;
+$c <<EOI && $b
cat <<EOF >=out;
foo
bar
@@ -42,11 +40,10 @@ foo
bar
EOO
EOI
-$b
: in-repeat
:
-$c <<EOI;
+$c <<EOI && $b
cat - <<EOF >>EOO
foo
bar
@@ -55,25 +52,31 @@ foo
bar
EOO
EOI
-$b
: non-existent
:
-$c <<EOI;
+$c <<EOI && $b
cat in 2>>/~%EOE% != 0
%cat: unable to print '.+/test/cat/non-existent/test/1/in': .+%
EOE
EOI
-$b
: empty-path
:
: Cat an empty path.
:
-$c <<EOI;
+$c <<EOI && $b
cat '' 2>"cat: invalid path ''" == 1
EOI
-$b
-# @@ When piping is ready test cat on a big file to test it is asynchronous.
-#
+: big
+:
+: Cat a big file (about 3MB) to test that the builtin is asynchronous.
+:
+{
+ s="------------------------------------------------------------------------"
+ s="$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s"
+ s="$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s"
+ s="$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s"
+ $c <"cat <'$s' | cat >'$s'" && $b
+}