summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/bind.test26
1 files changed, 22 insertions, 4 deletions
diff --git a/tests/bind.test b/tests/bind.test
index de9da70..3abb615 100644
--- a/tests/bind.test
+++ b/tests/bind.test
@@ -1573,24 +1573,42 @@ test bind-16.44 {ExpandPercents procedure} {
event gen .b.f <Gravity>
set x
} {?? ??}
-test bind-16.45 {ExpandPercents procedure} {
+test bind-16.45 {ExpandPercents procedure} -setup {
+ set savedBind(Entry) [bind Entry <Key>]
+ set savedBind(All) [bind all <Key>]
+
setup2
+
bind .b.e <Key> {set x "%M"}
bind Entry <Key> {set y "%M"}
bind all <Key> {set z "%M"}
+} -body {
set x none; set y none; set z none
event gen .b.e <Key-a>
list $x $y $z
-} {0 1 2}
-test bind-16.46 {ExpandPercents procedure} {
+} -cleanup {
+ bind all <Key> $savedBind(All)
+ bind Entry <Key> $savedBind(Entry)
+ unset savedBind
+} -result {0 1 2}
+test bind-16.46 {ExpandPercents procedure} -setup {
+ set savedBind(Entry) [bind Entry <Key>]
+ set savedBind(All) [bind all <Key>]
+
setup2
+
bind all <Key> {set z "%M"}
bind Entry <Key> {set y "%M"}
bind .b.e <Key> {set x "%M"}
+} -body {
set x none; set y none; set z none
event gen .b.e <Key-a>
list $x $y $z
-} {0 1 2}
+} -cleanup {
+ bind Entry <Key> $savedBind(Entry)
+ bind all <Key> $savedBind(All)
+ unset savedBind
+} -result {0 1 2}
test bind-17.1 {event command} {