aboutsummaryrefslogtreecommitdiff
path: root/tests/jim.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/jim.test')
-rw-r--r--tests/jim.test17
1 files changed, 9 insertions, 8 deletions
diff --git a/tests/jim.test b/tests/jim.test
index 419e044..4e3d02c 100644
--- a/tests/jim.test
+++ b/tests/jim.test
@@ -12,6 +12,7 @@ source [file dirname [info script]]/testing.tcl
needs constraint jim
catch {package require regexp}
testConstraint regexp [expr {[info commands regexp] ne {}}]
+testConstraint lambda [expr {[info commands ref] ne {}}]
################################################################################
# SET
@@ -2621,34 +2622,34 @@ test switch-9.10 {unpaired pattern} {
test switch-10.1 {no callback given to -command} {
catch {switch -command a { a {expr 1} b {expr 2} }}
} 1
-test switch-10.2 {callback expect wrong # args for -command} {
+test switch-10.2 {callback expect wrong # args for -command} lambda {
catch {switch -command [lambda {p1} {expr 1}] a { a {expr 1} b {expr 2} }}
} 1
-test switch-10.3 {callback to -command returns ever 0: no match} {
+test switch-10.3 {callback to -command returns ever 0: no match} lambda {
switch -command [lambda {p1 p2} {expr 0}] a a {expr 1} b {expr 2}
} {}
-test switch-10.4 {callback to -command returns 3 at first match} {
+test switch-10.4 {callback to -command returns 3 at first match} lambda {
switch -command [lambda {p1 p2} {expr 3}] a a {expr 1} b {expr 2}
} 1
-test switch-10.5 {[error] in callback to -command} {
+test switch-10.5 {[error] in callback to -command} lambda {
list [catch {
switch -command [lambda {p1 p2} {error "foo"}] a a {expr 1} b {expr 2}
} msg] $msg
} {1 foo}
-test switch-10.6 {[continue] in callback to -command} {
+test switch-10.6 {[continue] in callback to -command} lambda {
list [catch {
switch -command [lambda {p1 p2} {continue}] a a {expr 1} b {expr 2}
} msg] $msg
} {4 {}}
-test switch-10.7 {callback matches first if pat < str} {
+test switch-10.7 {callback matches first if pat < str} lambda {
switch -command [lambda {pat str} {expr {$pat < $str}}] 3 \
5 {expr 1} 3 {expr 2}
} {}
-test switch-10.8 {callback matches first if pat < str} {
+test switch-10.8 {callback matches first if pat < str} lambda {
switch -command [lambda {pat str} {expr {$pat < $str}}] 7 \
5 {expr 1} 3 {expr 2}
} 1
-test switch-10.9 {callback matches first if pat < str} {
+test switch-10.9 {callback matches first if pat < str} lambda {
switch -command [lambda {pat str} {expr {$pat < $str}}] 4 \
5 {expr 1} 3 {expr 2}
} 2