aboutsummaryrefslogtreecommitdiff
path: root/tests/wildcard
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2019-09-14 21:44:24 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2019-09-27 18:01:30 +0300
commitf488e6473a7d0562c0e2df6d107a36de4d30d9da (patch)
tree2be960ee637c852040f50c5b5583d8718b46e84d /tests/wildcard
parent3fa1b103014bab51f8f257e1e12f27f7e498f42e (diff)
Add support for bracket expressions in wildcard pattern matching
Diffstat (limited to 'tests/wildcard')
-rw-r--r--tests/wildcard/testscript70
1 files changed, 68 insertions, 2 deletions
diff --git a/tests/wildcard/testscript b/tests/wildcard/testscript
index a7ddb1a..4b88427 100644
--- a/tests/wildcard/testscript
+++ b/tests/wildcard/testscript
@@ -75,17 +75,76 @@
}
}
+ : bracket
+ :
+ {
+ : ordinary-char
+ :
+ {
+ $* a[bc]d abd : first
+ $* a[0-9b]d abd : after-range
+ $* a[bc]d acd : last
+ $* a[]bc]d a]d : closing-bracket
+ $* a[-bc]d a-d : first-dash
+ $* a[bc-]d a-d : last-dash
+ $* a[*]d a*d : star
+ $* a[?]d a?d : question
+ $* a[[]d a[d : open-bracket
+ $* a[xy]d abd == 1 : not-match
+
+ : not-expr
+ :
+ {
+ $* a[b a[b : not-closed
+ $* a[!b a[!b : not-closed-inverse
+ $* a[]b a[]b : empty
+ $* a[!] a[!] : empty-inverse
+ }
+ }
+
+ : range
+ :
+ {
+ $* a[0-8]d a0d : min
+ $* a[0-8]d a8d : max
+ $* a[0-8]d a5d : mid
+ $* a[0-8]d a9d == 1 : out
+ $* a[a0-8]d a1d : after-char
+ $* a[x0-9y]d abd == 1 : not-match
+ }
+
+ : inverse
+ :
+ {
+ $* a[!xy]d abd : match
+ $* a[!ab]d abd == 1 : not-match
+ }
+ }
+
+ : mixed
+ :
+ : Test patterns combining backtracking with the bracket expressions.
+ :
+ {
+ $* [0-9]a*b 9axb : bracket-star
+ $* a*b[0-9] axyb0 : star-bracket
+ $* a*b[0-9]x*y ab1xzy : star-bracket-star
+ $* a*[0-9]x*y[a-z] ax2xyb : star-bracket-star-bracket
+ }
+
: case-sensitivity
:
: Test that matching is case-insensitive on Windows and sensitive otherwise.
:
if ($cxx.target.class != 'windows')
{
- $* F*O/ foo/ == 1
+ $* F*O/ foo/ == 1
+ $* f[A-Z]o/ foo/ == 1
}
else
{
- $* F*O/ foo/
+ $* F*O/ foo/
+ $* f[A-Z]o/ foo/
}
}
@@ -161,6 +220,13 @@
baz
EOO
+ : recursive-with-brackets
+ :
+ $* **[!xy][rz] ../foo >>/EOO
+ bar/bar
+ baz
+ EOO
+
: self-recursive
:
{