From ad16356e1923ec1b4daf97b27b10a835cfe73ba7 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Tue, 19 Jan 2016 17:24:12 +0000 Subject: 37689: ! and ^ need to be tokenised in character sets --- Test/D02glob.ztst | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'Test/D02glob.ztst') 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 -- cgit 1.4.1