aboutsummaryrefslogtreecommitdiff
path: root/tests/test/script
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2017-02-09 16:35:03 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2017-02-11 01:01:56 +0300
commit4a416fd328d685b0946e5e6f40e5ea18e9c1adf0 (patch)
tree267dc00e8f430784b856cacefa6cfdc4ed039b5e /tests/test/script
parent4219d7f14e5c63e251f83fd0fff32b707e412cd6 (diff)
Add support for &dir/*[*][/] test path cleanup syntax
Diffstat (limited to 'tests/test/script')
-rw-r--r--tests/test/script/runner/cleanup.test139
1 files changed, 104 insertions, 35 deletions
diff --git a/tests/test/script/runner/cleanup.test b/tests/test/script/runner/cleanup.test
index 7b3539b..14e931e 100644
--- a/tests/test/script/runner/cleanup.test
+++ b/tests/test/script/runner/cleanup.test
@@ -144,47 +144,116 @@ b += --no-column
: wildcard
:
{
- : always
+ : self
:
- $c <'$* -d a/b -f a/b/c &a/***' && $b
+ {
+ : always
+ :
+ $c <'$* -d a/b -f a/b/c &a/***' && $b
- : maybe
- :
- $c <'$* &?a/***' && $b
+ : maybe
+ :
+ $c <'$* &?a/***' && $b
- : not-exists
- :
- : Test cleanup of a wildcard not matching any directory.
- :
- $c <'$* &a/***' && $b 2>>/EOE != 0
- testscript:1: error: registered for cleanup wildcard test/1/a/*** doesn't match a directory
- EOE
+ : not-exists
+ :
+ : Test cleanup of a wildcard not matching any directory.
+ :
+ $c <'$* &a/***' && $b 2>>/EOE != 0
+ testscript:1: error: registered for cleanup wildcard test/1/a/*** doesn't match a directory
+ EOE
- : out-wd
- :
- : Test cleanup of a wildcard out of the testscript working directory.
- :
- $c <'$* &../../a/***' && $b 2>>/EOE != 0
- testscript:1: error: wildcard cleanup ../../a/*** is out of working directory test/
- EOE
+ : out-wd
+ :
+ : Test cleanup of a wildcard out of the testscript working directory.
+ :
+ $c <'$* &../../a/***' && $b 2>>/EOE != 0
+ testscript:1: error: wildcard cleanup ../../a/*** is out of working directory test/
+ EOE
- : in-wd
- :
- : Test cleanup registration of a wildcard matching the directory that being
- : outside the test working directory is inside the testscript working
- : directory.
- :
- $c <'$* &../a/***' && $b 2>>/EOE != 0
- testscript:1: error: registered for cleanup wildcard test/a/*** doesn't match a directory
- EOE
+ : in-wd
+ :
+ : Test cleanup registration of a wildcard matching the directory that being
+ : outside the test working directory is inside the testscript working
+ : directory.
+ :
+ $c <'$* &../a/***' && $b 2>>/EOE != 0
+ testscript:1: error: registered for cleanup wildcard test/a/*** doesn't match a directory
+ EOE
- : not-dir
- :
- : Test cleanup of a file as a wildcard.
- :
- $c <'$* -f a &a/***' && $b 2>>/~%EOE% != 0
- %error: unable to remove directory test/1/a/: .+%
- EOE
+ : not-dir
+ :
+ : Test cleanup of a file as a wildcard.
+ :
+ $c <'$* -f a &a/***' && $b 2>>/~%EOE% != 0
+ %error: unable to remove directory test/1/a/: .+%
+ EOE
+ }
+
+ : dir
+ :
+ {
+ : always
+ :
+ {
+ : immediate
+ :
+ $c <'$* -d a/b &a/ &a/*/' && $b
+
+ : recursive
+ :
+ $c <'$* -d a/b/c &a/ &a/**/' && $b
+ }
+
+ : maybe
+ :
+ $c <'$* &?a/**/' && $b
+
+ : not-exists
+ :
+ : Test cleanup of a wildcard that doesn't match any directory.
+ :
+ $c <'$* &a/**/' && $b 2>>/EOE != 0
+ testscript:1: error: registered for cleanup wildcard test/1/a/**/ doesn't match a directory
+ EOE
+
+ : not-dir
+ :
+ : Test cleanup of a file as a directory wildcard.
+ :
+ $c <'$* -f a &a/**/' && $b 2>>/EOE != 0
+ testscript:1: error: registered for cleanup wildcard test/1/a/**/ doesn't match a directory
+ EOE
+
+ : not-empty
+ :
+ : Test cleanup of a non-empty directory as a wildcard.
+ :
+ $c <'$* -d a/b/c -f a/b/d &a/**/' && $b 2>>/EOE != 0
+ testscript:1: error: registered for cleanup directory test/1/a/b/ is not empty
+ info: wildcard: 'test/1/a/**/'
+ EOE
+ }
+
+ : file
+ :
+ {
+ : always
+ :
+ {
+ : immediate
+ :
+ $c <'$* -d a -f a/c &a/ &a/*' && $b
+
+ : recursive
+ :
+ $c <'$* -d a/b -f a/c -f a/b/e &a/ &a/b/ &a/**' && $b
+ }
+
+ : maybe
+ :
+ $c <'$* &?a/**' && $b
+ }
}
: order