summaryrefslogtreecommitdiffstats
path: root/tests/dialog.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/dialog.test')
-rw-r--r--tests/dialog.test24
1 files changed, 13 insertions, 11 deletions
diff --git a/tests/dialog.test b/tests/dialog.test
index a7c1ac9..d78d825 100644
--- a/tests/dialog.test
+++ b/tests/dialog.test
@@ -6,6 +6,9 @@ eval tcltest::configure $argv
tcltest::loadTestedCommands
namespace import -force tcltest::test
+# Import utility procs for specific functional areas
+testutils import dialog
+
test dialog-1.1 {tk_dialog command} -body {
tk_dialog
} -match glob -returnCodes error -result {wrong # args: should be "tk_dialog w title text bitmap default *"}
@@ -18,19 +21,14 @@ test dialog-1.3 {tk_dialog command} -body {
destroy .d
} -returnCodes error -result {bitmap "fooBitmap" not defined}
-
-test dialog-2.1 {tk_dialog operation} -setup {
- proc PressButton {btn} {
- if {![winfo ismapped $btn]} {
+test dialog-2.1 {tk_dialog operation} -body {
+ set x [after 5000 [list set tk::Priv(button) "no response"]]
+ after 100 {
+ if {![winfo ismapped .d.button0]} {
update
}
- event generate $btn <Enter>
- event generate $btn <Button-1> -x 5 -y 5
- event generate $btn <ButtonRelease-1> -x 5 -y 5
+ PressButton .d.button0
}
-} -body {
- set x [after 5000 [list set tk::Priv(button) "no response"]]
- after 100 PressButton .d.button0
set res [tk_dialog .d foo foo info 0 click]
after cancel $x
return $res
@@ -62,6 +60,10 @@ test dialog-2.3 {tk_dialog operation} -body {
destroy .b
} -result -1
+#
+# CLEANUP
+#
+
+testutils forget dialog
cleanupTests
return
-