summaryrefslogtreecommitdiffstats
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)
commit518e00a1dc2614aea4205513a4a3d32eb308ad72 (patch)
treea7d031af9fcb7da39e4e581c5944bd69bbe9295e
parentf96a9bb7bbc291ccecc44af0e69013df025d6871 (diff)
downloadtk-518e00a1dc2614aea4205513a4a3d32eb308ad72.zip
tk-518e00a1dc2614aea4205513a4a3d32eb308ad72.tar.gz
tk-518e00a1dc2614aea4205513a4a3d32eb308ad72.tar.bz2
Modify bind tests for '%M' to save/restore the 'Key' bindings for both 'All' and 'Entry'. Fix for [6b13bf5ebf].
-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} {