diff options
Diffstat (limited to 'tests/ttk/combobox.test')
-rw-r--r-- | tests/ttk/combobox.test | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/tests/ttk/combobox.test b/tests/ttk/combobox.test index cf8113c..d5e031f 100644 --- a/tests/ttk/combobox.test +++ b/tests/ttk/combobox.test @@ -2,7 +2,7 @@ # ttk::combobox widget tests # -package require Tk +package require tk package require tcltest 2.2 namespace import -force tcltest::* loadTestedCommands @@ -21,8 +21,8 @@ test combobox-1.end "Combobox tests -- cleanup" -body { test combobox-2.0 "current command" -body { ttk::combobox .cb -values [list a b c d e a] - .cb current -} -result -1 + expr {[.cb current]<0} +} -result 1 test combobox-2.1 "current -- set index" -body { .cb current 5 @@ -41,8 +41,8 @@ test combobox-2.3 "current -- change value" -body { test combobox-2.4 "current -- value not in list" -body { .cb set "z" - .cb current -} -result -1 + expr {[.cb current]<0} +} -result 1 test combobox-2.5 "current -- set to end index" -body { .cb configure -values [list a b c d e thelastone] @@ -53,12 +53,12 @@ test combobox-2.5 "current -- set to end index" -body { test combobox-2.6 "current -- set to unknown index" -body { .cb configure -values [list a b c d e] .cb current notanindex -} -returnCodes error -result {Incorrect index notanindex} +} -returnCodes error -result {bad index "notanindex"} test combobox-2.7 {current -- set to 0 index when empty [bug 924835c36d]} -body { .cb configure -values {} .cb current 0 -} -returnCodes error -result {Index 0 out of range} +} -returnCodes error -result {index "0" out of range} test combobox-2.8 "current -- set to end index in an empty combobox" -body { .cb configure -values {} @@ -104,4 +104,18 @@ test combobox-1890211 "ComboboxSelected event after listbox unposted" \ destroy .cb } +test combobox-4.1 "style command" -body { + ttk::combobox .w + list [.w cget -style] [.w style] [winfo class .w] +} -cleanup { + destroy .w +} -result {{} TCombobox TCombobox} +test combobox-4.2 "style command" -body { + ttk::style configure customStyle.TCombobox + ttk::combobox .w -style customStyle.TCombobox + list [.w cget -style] [.w style] [winfo class .w] +} -cleanup { + destroy .w +} -result {customStyle.TCombobox customStyle.TCombobox TCombobox} + tcltest::cleanupTests |