summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorpatthoyts <patthoyts@users.sourceforge.net>2008-04-14 20:59:51 (GMT)
committerpatthoyts <patthoyts@users.sourceforge.net>2008-04-14 20:59:51 (GMT)
commit6ee2ac2db060471516838a8dd4a07ff3bf8fc410 (patch)
tree8dc97a04acfda3ee4cef886b6275ab4a833c39e2 /tests
parente3fe238d0a72f92aeec5f6104dc0acff33fb6447 (diff)
downloadtk-6ee2ac2db060471516838a8dd4a07ff3bf8fc410.zip
tk-6ee2ac2db060471516838a8dd4a07ff3bf8fc410.tar.gz
tk-6ee2ac2db060471516838a8dd4a07ff3bf8fc410.tar.bz2
backported tk_chooseColor -title fix from HEAD
Diffstat (limited to 'tests')
-rw-r--r--tests/winDialog.test80
1 files changed, 75 insertions, 5 deletions
diff --git a/tests/winDialog.test b/tests/winDialog.test
index d4e24e5..4c172cb 100644
--- a/tests/winDialog.test
+++ b/tests/winDialog.test
@@ -6,7 +6,7 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# Copyright (c) 1998-1999 ActiveState Corporation.
#
-# RCS: @(#) $Id: winDialog.test,v 1.15 2007/12/13 15:27:55 dgp Exp $
+# RCS: @(#) $Id: winDialog.test,v 1.15.2.1 2008/04/14 20:59:51 patthoyts Exp $
package require tcltest 2.1
eval tcltest::configure $argv
@@ -57,10 +57,80 @@ proc SetText {button text} {
return [testwinevent $::tk_dialog $button WM_SETTEXT $text]
}
-test winDialog-1.1 {Tk_ChooseColorObjCmd} {nt} {
-} {}
-
-test winDialog-2.1 {ColorDlgHookProc} {nt} {
+test winDialog-1.1.0 {Tk_ChooseColorObjCmd} -constraints {
+ testwinevent
+} -body {
+ start {tk_chooseColor}
+ then {
+ Click cancel
+ }
+} -result {0}
+test winDialog-1.1.1 {Tk_ChooseColorObjCmd} -constraints {
+ testwinevent
+} -body {
+ start {set clr [tk_chooseColor -initialcolor "#ff9933"]}
+ then {
+ set x [Click cancel]
+ }
+ list $x $clr
+} -result {0 {}}
+test winDialog-1.1.2 {Tk_ChooseColorObjCmd} -constraints {
+ testwinevent
+} -body {
+ start {set clr [tk_chooseColor -initialcolor "#ff9933"]}
+ then {
+ set x [Click 1]
+ }
+ list $x $clr
+} -result [list 0 "#ff9933"]
+test winDialog-1.1.3 {Tk_ChooseColorObjCmd: -title} -constraints {
+ testwinevent
+} -body {
+ set x {}
+ start {set clr [tk_chooseColor -initialcolor "#ff9933" -title "Hello"]}
+ then {
+ array set a [testgetwindowinfo $::tk_dialog]
+ if {[info exists a(text)]} {lappend x $a(text)}
+ lappend x [Click 1]
+ }
+ lappend x $clr
+} -result [list Hello 0 "#ff9933"]
+test winDialog-1.1.4 {Tk_ChooseColorObjCmd: -title} -constraints {
+ testwinevent
+} -body {
+ set x {}
+ start {
+ set clr [tk_chooseColor -initialcolor "#ff9933" \
+ -title "\u041f\u0440\u0438\u0432\u0435\u0442"]
+ }
+ then {
+ array set a [testgetwindowinfo $::tk_dialog]
+ if {[info exists a(text)]} {lappend x $a(text)}
+ lappend x [Click 1]
+ }
+ lappend x $clr
+} -result [list "\u041f\u0440\u0438\u0432\u0435\u0442" 0 "#ff9933"]
+test winDialog-1.1.5 {Tk_ChooseColorObjCmd: -parent} -constraints {
+ testwinevent
+} -body {
+ start {set clr [tk_chooseColor -initialcolor "#ff9933" -parent .]}
+ set x {}
+ then {
+ array set a [testgetwindowinfo $::tk_dialog]
+ if {[info exists a(parent)]} {
+ append x [expr {$a(parent) == [wm frame .]}]
+ }
+ Click 1
+ }
+ list $x $clr
+} -result [list 1 "#ff9933"]
+test winDialog-1.1.6 {Tk_ChooseColorObjCmd: -parent} -constraints {
+ testwinevent
+} -body {
+ tk_chooseColor -initialcolor "#ff9933" -parent .xyzzy12
+} -returnCodes error -match glob -result {bad window path name*}
+
+test winDialog-2.1 {ColorDlgHookProc} {emptyTest nt} {
} {}
test winDialog-3.1 {Tk_GetOpenFileObjCmd} {nt testwinevent} {