diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2008-03-21 19:09:12 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2008-03-21 19:09:12 (GMT) |
commit | 1091442a83aa05518551c2974271264cb71edf90 (patch) | |
tree | ecc05f141adc4f7397459d8197334f378724459d /tests | |
parent | 1259aa8413c5871bde497d9cb1ddb1a6fe78b383 (diff) | |
download | tcl-1091442a83aa05518551c2974271264cb71edf90.zip tcl-1091442a83aa05518551c2974271264cb71edf90.tar.gz tcl-1091442a83aa05518551c2974271264cb71edf90.tar.bz2 |
Added more tests of regexp-mode compilation of the [switch] command. [Bug 1854435]
Diffstat (limited to 'tests')
-rw-r--r-- | tests/switch.test | 108 |
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: |