summaryrefslogtreecommitdiffstats
path: root/tests/ttk/ttk.test
diff options
context:
space:
mode:
authorjenglish <jenglish@flightlab.com>2008-12-31 23:10:47 (GMT)
committerjenglish <jenglish@flightlab.com>2008-12-31 23:10:47 (GMT)
commitb9039ab7be24d01ed44ff7052c83d5511f25f8b0 (patch)
treed93a434b6b1af4fe35b1d1daaa8a4161ce1b2898 /tests/ttk/ttk.test
parente74b92a66cb3c8d158ded0ddabf6740c1d038850 (diff)
downloadtk-b9039ab7be24d01ed44ff7052c83d5511f25f8b0.zip
tk-b9039ab7be24d01ed44ff7052c83d5511f25f8b0.tar.gz
tk-b9039ab7be24d01ed44ff7052c83d5511f25f8b0.tar.bz2
tests/ttk/{checkbutton,radiobutton}.test: split out from ttk.test.
Diffstat (limited to 'tests/ttk/ttk.test')
-rw-r--r--tests/ttk/ttk.test91
1 files changed, 5 insertions, 86 deletions
diff --git a/tests/ttk/ttk.test b/tests/ttk/ttk.test
index 2bb3d04..2747727 100644
--- a/tests/ttk/ttk.test
+++ b/tests/ttk/ttk.test
@@ -129,7 +129,6 @@ test ttk-selfdestruct-ok-1 "Intentional self-destruction" -body {
#
# Basic tests.
#
-
test ttk-1.1 "Create button" -body {
pack [ttk::button .t] -expand true -fill both
update
@@ -139,7 +138,11 @@ test ttk-1.2 "Check style" -body {
.t cget -style
} -result {}
-test ttk-1.4 "Restore default style" -body {
+test ttk-1.3 "Set bad style" -body {
+ .t configure -style "nosuchstyle"
+} -returnCodes 1 -result {Layout nosuchstyle not found}
+
+test ttk-1.4 "Original style preserved" -body {
.t cget -style
} -result ""
@@ -266,90 +269,6 @@ test ttk-4.4 "Bad resource specifications" -body {
}
#
-# checkbutton tests
-#
-test ttk-5.1 "Checkbutton check" -body {
- pack [ttk::checkbutton .cb -text "TCheckbutton" -variable cb]
-}
-test ttk-5.2 "Checkbutton invoke" -body {
- .cb invoke
- list [set ::cb] [.cb instate selected]
-} -result [list 1 1]
-test ttk-5.3 "Checkbutton reinvoke" -body {
- .cb invoke
- list [set ::cb] [.cb instate selected]
-} -result [list 0 0]
-
-test ttk-5.4 "Checkbutton variable" -body {
- set result []
- set ::cb 1
- lappend result [.cb instate selected]
- set ::cb 0
- lappend result [.cb instate selected]
-} -result {1 0}
-
-test ttk-5.5 "Unset checkbutton variable" -body {
- set result []
- unset ::cb
- lappend result [.cb instate alternate] [info exists ::cb]
- set ::cb 1
- lappend result [.cb instate alternate] [info exists ::cb]
-} -result {1 0 0 1}
-
-# See #1257319
-test ttk-5.6 "Checkbutton default variable" -body {
- destroy .cb ; unset -nocomplain {} ; set result [list]
- ttk::checkbutton .cb -onvalue on -offvalue off
- lappend result [.cb cget -variable] [info exists .cb] [.cb state]
- .cb invoke
- lappend result [info exists .cb] [set .cb] [.cb state]
- .cb invoke
- lappend result [info exists .cb] [set .cb] [.cb state]
-} -result [list .cb 0 alternate 1 on selected 1 off {}]
-
-#
-# radiobutton tests
-#
-test ttk-7.1 "Radiobutton check" -body {
- pack \
- [ttk::radiobutton .rb1 -text "One" -variable choice -value 1] \
- [ttk::radiobutton .rb2 -text "Two" -variable choice -value 2] \
- [ttk::radiobutton .rb3 -text "Three" -variable choice -value 3] \
- ;
-}
-test ttk-7.2 "Radiobutton invoke" -body {
- .rb1 invoke
- set ::choice
-} -result 1
-
-test ttk-7.3 "Radiobutton state" -body {
- .rb1 instate selected
-} -result 1
-
-test ttk-7.4 "Other radiobutton invoke" -body {
- .rb2 invoke
- set ::choice
-} -result 2
-
-test ttk-7.5 "Other radiobutton state" -body {
- .rb2 instate selected
-} -result 1
-
-test ttk-7.6 "First radiobutton state" -body {
- .rb1 instate selected
-} -result 0
-
-test ttk-7.7 "Unset radiobutton variable" -body {
- unset ::choice
- list [info exists ::choice] [.rb1 instate alternate] [.rb2 instate alternate]
-} -result {0 1 1}
-
-test ttk-7.8 "Reset radiobutton variable" -body {
- set ::choice 2
- list [info exists ::choice] [.rb1 instate alternate] [.rb2 instate alternate]
-} -result {1 0 0}
-
-#
# -compound tests:
#
variable iconData \