summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJoe Mistachkin <joe@mistachkin.com>2015-02-06 21:46:44 (GMT)
committerJoe Mistachkin <joe@mistachkin.com>2015-02-06 21:46:44 (GMT)
commita5e0b9d8b5502365ba445324281cd06b3272ef8d (patch)
tree62e40b4040878b8a8b47e4e6a21743f0aa5c0bbb /tests
parentb7511339585f3051bb38b3509ac4292ae983cfd8 (diff)
downloadtk-a5e0b9d8b5502365ba445324281cd06b3272ef8d.zip
tk-a5e0b9d8b5502365ba445324281cd06b3272ef8d.tar.gz
tk-a5e0b9d8b5502365ba445324281cd06b3272ef8d.tar.bz2
Modify bind tests for '%M' to save/restore the 'Key' bindings for both 'All' and 'Entry'. Fix for [6b13bf5ebf].
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} {