summaryrefslogtreecommitdiffstats
path: root/tests/dialog.test
diff options
context:
space:
mode:
authorapnadkarni <apnmbx-wits@yahoo.com>2025-05-23 02:28:37 (GMT)
committerapnadkarni <apnmbx-wits@yahoo.com>2025-05-23 02:28:37 (GMT)
commit25f16a070dd42bc33af26334d2071a81377aee5c (patch)
treef20dcb1268a10aa292953f0ffa965881fefed78b /tests/dialog.test
parente1675428ff056ed7a44fcc26a26dc5adb8e5f9eb (diff)
parentf8e4b115fdb0f0886cd853323937b8ea757fcc21 (diff)
downloadtk-core-tip-716.zip
tk-core-tip-716.tar.gz
tk-core-tip-716.tar.bz2
Merge core-9-0-branchcore-tip-716
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
-