diff options
author | ashok <ashok> | 2014-12-03 16:33:49 (GMT) |
---|---|---|
committer | ashok <ashok> | 2014-12-03 16:33:49 (GMT) |
commit | a59d256b75d74edc1e878bf776e394636df0a422 (patch) | |
tree | 7d039ec15045c8571b702275696a1bb75298e2c1 /tests | |
parent | 0da68cf7b3a0be2417f220ce6a09711934774b76 (diff) | |
download | tk-a59d256b75d74edc1e878bf776e394636df0a422.zip tk-a59d256b75d74edc1e878bf776e394636df0a422.tar.gz tk-a59d256b75d74edc1e878bf776e394636df0a422.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')
-rw-r--r-- | tests/winDialog.test | 18 |
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 |