summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/switch.test108
1 files changed, 107 insertions, 1 deletions
diff --git a/tests/switch.test b/tests/switch.test
index 45f494f..9a46191 100644
--- a/tests/switch.test
+++ b/tests/switch.test
@@ -11,7 +11,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: switch.test,v 1.20 2008/02/12 10:27:27 dkf Exp $
+# RCS: @(#) $Id: switch.test,v 1.21 2008/03/21 19:09:13 dkf Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest 2
@@ -635,7 +635,113 @@ test switch-14.4 {-regexp -- compilation [Bug 1854399]} {
}
foo
} yes
+test switch-14.5 {switch -regexp compilation} {
+ apply {{} {
+ switch -regexp -- 0 {
+ {0|1|2} {return yes}
+ default {return no}
+ }
+ }}
+} yes
+test switch-14.6 {switch -regexp compilation} {
+ apply {{} {
+ switch -regexp -- 0 {
+ {0|11|222} {return yes}
+ default {return no}
+ }
+ }}
+} yes
+test switch-14.7 {switch -regexp compilation} {
+ apply {{} {
+ switch -regexp -- 0 {
+ {[012]} {return yes}
+ default {return no}
+ }
+ }}
+} yes
+test switch-14.8 {switch -regexp compilation} {
+ apply {{} {
+ switch -regexp -- x {
+ {0|1|2} {return yes}
+ default {return no}
+ }
+ }}
+} no
+test switch-14.9 {switch -regexp compilation} {
+ apply {{} {
+ switch -regexp -- x {
+ {0|11|222} {return yes}
+ default {return no}
+ }
+ }}
+} no
+test switch-14.10 {switch -regexp compilation} {
+ apply {{} {
+ switch -regexp -- x {
+ {[012]} {return yes}
+ default {return no}
+ }
+ }}
+} no
+test switch-14.11 {switch -regexp compilation} {
+ apply {{} {
+ switch -regexp -- x {
+ {0|1|2} {return yes}
+ .+ {return yes2}
+ default {return no}
+ }
+ }}
+} yes2
+test switch-14.12 {switch -regexp compilation} {
+ apply {{} {
+ switch -regexp -- x {
+ {0|11|222} {return yes}
+ .+ {return yes2}
+ default {return no}
+ }
+ }}
+} yes2
+test switch-14.13 {switch -regexp compilation} {
+ apply {{} {
+ switch -regexp -- x {
+ {[012]} {return yes}
+ .+ {return yes2}
+ default {return no}
+ }
+ }}
+} yes2
+test switch-14.14 {switch -regexp compilation} {
+ apply {{} {
+ switch -regexp -- {} {
+ {0|1|2} {return yes}
+ .+ {return yes2}
+ default {return no}
+ }
+ }}
+} no
+test switch-14.15 {switch -regexp compilation} {
+ apply {{} {
+ switch -regexp -- {} {
+ {0|11|222} {return yes}
+ .+ {return yes2}
+ default {return no}
+ }
+ }}
+} no
+test switch-14.16 {switch -regexp compilation} {
+ apply {{} {
+ switch -regexp -- {} {
+ {[012]} {return yes}
+ .+ {return yes2}
+ default {return no}
+ }
+ }}
+} no
# cleanup
::tcltest::cleanupTests
return
+
+# Local Variables:
+# mode: tcl
+# End: