aboutsummaryrefslogtreecommitdiff
path: root/tests/test/script/runner/cleanup.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/runner/cleanup.test
parent749f748ae6ded6e229214d2dddf3c45482bffbd3 (diff)
Move builtin and runner tests to '$c ... && $b' pattern
Diffstat (limited to 'tests/test/script/runner/cleanup.test')
-rw-r--r--tests/test/script/runner/cleanup.test81
1 files changed, 26 insertions, 55 deletions
diff --git a/tests/test/script/runner/cleanup.test b/tests/test/script/runner/cleanup.test
index 1c3ccae..7b3539b 100644
--- a/tests/test/script/runner/cleanup.test
+++ b/tests/test/script/runner/cleanup.test
@@ -6,26 +6,20 @@
b += --no-column
-# @@ TODO: $c <'$* -f a &a' && $b
-#
-
: file
:
{
: always
:
- $c <'$* -f a &a';
- $b
+ $c <'$* -f a &a' && $b
: maybe
:
- $c <'$* &?a';
- $b
+ $c <'$* &?a' && $b
: never
:
- $c <'$* &!a';
- $b
+ $c <'$* &!a' && $b
: implicit
:
@@ -33,30 +27,27 @@ b += --no-column
: implicitly registered for cleanup. If it were, the test would fail due to
: the file absence at the cleanup time.
:
- $c <<EOI;
+ $c <<EOI && $b
touch ../../a;
rm -f ../../a
EOI
- $b
: append
:
: Test that file append redirect does not not register cleanup. If it did,
: that cleanup would fail as the file would be already deleted by rm.
:
- $c <<EOI;
+ $c <<EOI && $b
touch a &!a;
$* -o foo >+a;
rm a
EOI
- $b
: not-exists
:
: Test cleanup of non-existing file.
:
- $c <'$* &a';
- $b 2>>/EOE != 0
+ $c <'$* &a' && $b 2>>/EOE != 0
testscript:1: error: registered for cleanup file test/1/a does not exist
EOE
@@ -64,8 +55,7 @@ b += --no-column
:
: Test explicit cleanup of a file out of the testscript working directory.
:
- $c <'$* &../../a';
- $b 2>>/EOE != 0
+ $c <'$* &../../a' && $b 2>>/EOE != 0
testscript:1: error: file cleanup ../../a is out of working directory test/
EOE
@@ -74,8 +64,7 @@ b += --no-column
: Test cleanup explicit registration of a file being outside the test working
: directory but inside the script working directory.
:
- $c <'$* &../a';
- $b 2>>/EOE != 0
+ $c <'$* &../a' && $b 2>>/EOE != 0
testscript:1: error: registered for cleanup file test/a does not exist
EOE
@@ -83,8 +72,7 @@ b += --no-column
:
: Test cleanup of a directory as a file.
:
- $c <'$* -d a &a';
- $b 2>>/~%EOE% != 0
+ $c <'$* -d a &a' && $b 2>>/~%EOE% != 0
%error: unable to remove file test/1/a: .+%
EOE
}
@@ -94,13 +82,11 @@ b += --no-column
{
: always
:
- $c <'$* -d a &a/';
- $b
+ $c <'$* -d a &a/' && $b
: maybe
:
- $c <'$* &?a/';
- $b
+ $c <'$* &?a/' && $b
: implicit
:
@@ -108,18 +94,16 @@ b += --no-column
: not implicitly registered for cleanup. If it were, the test would fail due
: to the directory absence at the cleanup time.
:
- $c <<EOI;
+ $c <<EOI && $b
mkdir ../../a;
rm -r -f ../../a
EOI
- $b
: not-exists
:
: Test cleanup of non-existing directory.
:
- $c <'$* &a/';
- $b 2>>/EOE != 0
+ $c <'$* &a/' && $b 2>>/EOE != 0
testscript:1: error: registered for cleanup directory test/1/a/ does not exist
EOE
@@ -127,8 +111,7 @@ b += --no-column
:
: Test cleanup of a directory out of the testscript working directory.
:
- $c <'$* &../../a/';
- $b 2>>/EOE != 0
+ $c <'$* &../../a/' && $b 2>>/EOE != 0
testscript:1: error: directory cleanup ../../a/ is out of working directory test/
EOE
@@ -137,8 +120,7 @@ b += --no-column
: Test cleanup explicit registration of a directory being outside the test
: working directory but inside the testscript working directory.
:
- $c <'$* &../a/';
- $b 2>>/EOE != 0
+ $c <'$* &../a/' && $b 2>>/EOE != 0
testscript:1: error: registered for cleanup directory test/a/ does not exist
EOE
@@ -146,8 +128,7 @@ b += --no-column
:
: Test cleanup of a non-empty directory.
:
- $c <'$* -d a -f a/b &a/';
- $b 2>>/EOE != 0
+ $c <'$* -d a -f a/b &a/' && $b 2>>/EOE != 0
testscript:1: error: registered for cleanup directory test/1/a/ is not empty
EOE
@@ -155,8 +136,7 @@ b += --no-column
:
: Test cleanup of a file as a directory.
:
- $c <'$* -f a &a/';
- $b 2>>/~%EOE% != 0
+ $c <'$* -f a &a/' && $b 2>>/~%EOE% != 0
%error: unable to remove directory test/1/a/: .+%
EOE
}
@@ -166,20 +146,17 @@ b += --no-column
{
: always
:
- $c <'$* -d a/b -f a/b/c &a/***';
- $b
+ $c <'$* -d a/b -f a/b/c &a/***' && $b
: maybe
:
- $c <'$* &?a/***';
- $b
+ $c <'$* &?a/***' && $b
: not-exists
:
: Test cleanup of a wildcard not matching any directory.
:
- $c <'$* &a/***';
- $b 2>>/EOE != 0
+ $c <'$* &a/***' && $b 2>>/EOE != 0
testscript:1: error: registered for cleanup wildcard test/1/a/*** doesn't match a directory
EOE
@@ -187,8 +164,7 @@ b += --no-column
:
: Test cleanup of a wildcard out of the testscript working directory.
:
- $c <'$* &../../a/***';
- $b 2>>/EOE != 0
+ $c <'$* &../../a/***' && $b 2>>/EOE != 0
testscript:1: error: wildcard cleanup ../../a/*** is out of working directory test/
EOE
@@ -198,8 +174,7 @@ b += --no-column
: outside the test working directory is inside the testscript working
: directory.
:
- $c <'$* &../a/***';
- $b 2>>/EOE != 0
+ $c <'$* &../a/***' && $b 2>>/EOE != 0
testscript:1: error: registered for cleanup wildcard test/a/*** doesn't match a directory
EOE
@@ -207,8 +182,7 @@ b += --no-column
:
: Test cleanup of a file as a wildcard.
:
- $c <'$* -f a &a/***';
- $b 2>>/~%EOE% != 0
+ $c <'$* -f a &a/***' && $b 2>>/~%EOE% != 0
%error: unable to remove directory test/1/a/: .+%
EOE
}
@@ -217,15 +191,13 @@ b += --no-column
:
: Test that cleanup is performed in registration reversed order.
:
-$c <'$* -d a/b &a/ &a/b/';
-$b
+$c <'$* -d a/b &a/ &a/b/' && $b
: implicit-overwrite
:
: Test an implicit cleanup being overwritten with the explicit one,
:
-$c <'$* -o foo >=a &!a';
-$b 2>>/EOE != 0
+$c <'$* -o foo >=a &!a' && $b 2>>/EOE != 0
testscript:1: error: registered for cleanup directory test/1/ is not empty
EOE
@@ -233,10 +205,9 @@ EOE
:
: Test an explicit cleanup not being overwritten with the implicit one.
:
-$c <<EOO;
+$c <<EOO && $b 2>>/EOE != 0
$* &!a;
$* -o foo >=a
EOO
-$b 2>>/EOE != 0
testscript:2: error: registered for cleanup directory test/1/ is not empty
EOE