summaryrefslogtreecommitdiffstats
path: root/tests/winDialog.test
diff options
context:
space:
mode:
authorashok <ashok>2014-12-03 16:33:49 (GMT)
committerashok <ashok>2014-12-03 16:33:49 (GMT)
commit9ec55a369e6054fd54ad66e75ce57ff65c467d24 (patch)
tree7d039ec15045c8571b702275696a1bb75298e2c1 /tests/winDialog.test
parent0f8874c514bb3c448a4f007df3262774df8a0252 (diff)
downloadtk-9ec55a369e6054fd54ad66e75ce57ff65c467d24.zip
tk-9ec55a369e6054fd54ad66e75ce57ff65c467d24.tar.gz
tk-9ec55a369e6054fd54ad66e75ce57ff65c467d24.tar.bz2
Fix for 4a0451f529. Needed a Tcl_ResetResult after recursive event
loop otherwise clicking Cancel would return a non-empty result in case a script was run in the background as part of the event loop. Also updated test suite which did not actually check that a Cancel resulted in an empty event string.
Diffstat (limited to 'tests/winDialog.test')
-rw-r--r--tests/winDialog.test18
1 files changed, 12 insertions, 6 deletions
diff --git a/tests/winDialog.test b/tests/winDialog.test
index cd8d937..b7847a5 100644
--- a/tests/winDialog.test
+++ b/tests/winDialog.test
@@ -251,10 +251,14 @@ test winDialog-5.4 {GetFileName: Tcl_GetIndexFromObj() != TCL_OK} -constraints {
test winDialog-5.5 {GetFileName: Tcl_GetIndexFromObj() == TCL_OK} -constraints {
nt testwinevent
} -body {
- start {tk_getOpenFile -title bar}
- then {
+ start {set x [tk_getOpenFile -title bar]}
+ set y [then {
Click cancel
- }
+ }]
+ # Note this also tests fix for
+ # http://core.tcl.tk/tk/tktview/4a0451f5291b3c9168cc560747dae9264e1d2ef6
+ # $x is expected to be empty
+ append x $y
} -result {0}
test winDialog-5.6 {GetFileName: valid option, but missing value} -constraints {
nt
@@ -533,10 +537,12 @@ test winDialog-8.1 {OFNHookProc} -constraints {emptyTest nt} -body {}
test winDialog-9.1 {Tk_ChooseDirectoryObjCmd: no arguments} -constraints {
nt testwinevent
} -body {
- start {tk_chooseDirectory}
- then {
+ start {set x [tk_chooseDirectory]}
+ set y [then {
Click cancel
- }
+ }]
+ # $x should be "" on a Cancel
+ append x $y
} -result {0}
test winDialog-9.2 {Tk_ChooseDirectoryObjCmd: one argument} -constraints {
nt