about summary refs log tree commit diff
path: root/Test/D02glob.ztst
diff options
context:
space:
mode:
authorPeter Stephenson <pws@zsh.org>2016-01-19 17:24:12 +0000
committerPeter Stephenson <pws@zsh.org>2016-01-19 17:24:12 +0000
commitad16356e1923ec1b4daf97b27b10a835cfe73ba7 (patch)
tree714fe0c1d6c89a32ac5194475402fa6dc3f8d218 /Test/D02glob.ztst
parent8eb9070d6785f423dd9bdbbb0513aa47c8a08d62 (diff)
downloadzsh-ad16356e1923ec1b4daf97b27b10a835cfe73ba7.tar.gz
zsh-ad16356e1923ec1b4daf97b27b10a835cfe73ba7.tar.xz
zsh-ad16356e1923ec1b4daf97b27b10a835cfe73ba7.zip
37689: ! and ^ need to be tokenised in character sets
Diffstat (limited to 'Test/D02glob.ztst')
-rw-r--r--Test/D02glob.ztst33
1 files changed, 33 insertions, 0 deletions
diff --git a/Test/D02glob.ztst b/Test/D02glob.ztst
index 89256e303..a6b704a8e 100644
--- a/Test/D02glob.ztst
+++ b/Test/D02glob.ztst
@@ -622,3 +622,36 @@
 0:quoted - works in pattern in parameter
 >bcdef
 >cdef
+
+  [[ a != [^a] ]]
+0:^ active in character class if not quoted
+
+  [[ a = ['^a'] ]]
+0:^ not active in character class if quoted
+
+  [[ a != [!a] ]]
+0:! active in character class if not quoted
+
+  [[ a = ['!a'] ]]
+0:! not active in character class if quoted
+
+  # Actually, we don't need the quoting here,
+  # c.f. the next test.  This just makes it look
+  # more standard.
+  cset="^a-z"
+  [[ "^" = ["$cset"] ]] || print Fail 1
+  [[ "a" = ["$cset"] ]] || print Fail 2
+  [[ "-" = ["$cset"] ]] || print Fail 3
+  [[ "z" = ["$cset"] ]] || print Fail 4
+  [[ "1" != ["$cset"] ]] || print Fail 5
+  [[ "b" != ["$cset"] ]] || print Fail 6
+0:character set specified as quoted variable
+
+  cset="^a-z"
+  [[ "^" = [$~cset] ]] || print Fail 1
+  [[ "a" != [$~cset] ]] || print Fail 2
+  [[ "-" = [$~cset] ]] || print Fail 3
+  [[ "z" != [$~cset] ]] || print Fail 4
+  [[ "1" = [$~cset] ]] || print Fail 5
+  [[ "b" != [$~cset] ]] || print Fail 6
+0:character set specified as active variabe