diff options
Diffstat (limited to 'tests/switch.test')
-rw-r--r-- | tests/switch.test | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/tests/switch.test b/tests/switch.test index 3309bc5..8b1a4a5 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.18 2007/12/13 15:26:07 dgp Exp $ +# RCS: @(#) $Id: switch.test,v 1.19 2007/12/19 21:09:38 hobbs Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest 2 @@ -595,6 +595,41 @@ test switch-13.6 {-indexvar -matchvar combinations} { } msg] $x $y $msg } {1 {{0 1}} - {can't set "y(y)": variable isn't array}} +test switch-14.1 {-regexp -- compilation [Bug 1854399]} { + switch -regexp -- 0 { + {[0-9]+} {return yes} + default {return no} + } + foo +} yes +test switch-14.2 {-regexp -- compilation [Bug 1854399]} { + proc foo {} { + switch -regexp -- 0 { + {[0-9]+} {return yes} + default {return no} + } + } + foo +} yes +test switch-14.3 {-regexp -- compilation [Bug 1854399]} { + proc foo {} { + switch -regexp -- 0 { + {\d+} {return yes} + default {return no} + } + } + foo +} yes +test switch-14.4 {-regexp -- compilation [Bug 1854399]} { + proc foo {} { + switch -regexp -- 0 { + {0} {return yes} + default {return no} + } + } + foo +} yes + # cleanup ::tcltest::cleanupTests return |