diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/jim.test | 9 | ||||
-rw-r--r-- | tests/lsearch.test | 8 |
2 files changed, 17 insertions, 0 deletions
diff --git a/tests/jim.test b/tests/jim.test index 121e909..eaef8aa 100644 --- a/tests/jim.test +++ b/tests/jim.test @@ -2500,6 +2500,15 @@ test switch-3.7 {-exact vs. -glob vs. -regexp} { list [catch {switch -foo a b c} msg] $msg } {1 {bad option "-foo": must be -exact, -glob, -regexp, -command procname or --}} +test switch-3.8 {switch -regexp with option-like pattern} regexp { + switch -regexp -- -def { + -abc {concat first} + -def {concat second} + -ghi {concat third} + default {concat none} + } +} second + test switch-4.1 {error in executed command} { list [catch {switch a a {error "Just a test"} default {expr 1}} msg] \ $msg diff --git a/tests/lsearch.test b/tests/lsearch.test index 1eb6607..ff1342a 100644 --- a/tests/lsearch.test +++ b/tests/lsearch.test @@ -72,6 +72,14 @@ test lsearch-2.9 {search modes, -nocase} { lsearch -nocase -glob {b.x ^bc xy bcx} B* } 0 +test lsearch-2.10 {regexp with option-looking pattern} regexp { + lsearch -regexp {-abc -def -ghi} -def +} 1 + +test lsearch-2.11 {regexp with option-looking pattern, -nocase} regexp { + lsearch -nocase -regexp {-abc -def -ghi} -DEF +} 1 + test lsearch-3.1 {lsearch errors} { list [catch lsearch msg] } {1} |