aboutsummaryrefslogtreecommitdiff
path: root/tests/test/script/builtin/cat.test
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2017-01-30 23:31:45 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2017-01-31 15:54:40 +0300
commit7cf026b8989a71a0d0e775e21e697ba9f1bee987 (patch)
tree9d7b78c91d1dae66bf2faabba7aa9acc11a17f6d /tests/test/script/builtin/cat.test
parent749f748ae6ded6e229214d2dddf3c45482bffbd3 (diff)
Move builtin and runner tests to '$c ... && $b' pattern
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
+}