summaryrefslogtreecommitdiffstats
path: root/tests/ttk
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-09-28 15:56:15 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-09-28 15:56:15 (GMT)
commitf229cc87ab8e94200976b0233cfe07e5887cea49 (patch)
tree014c5605c2a3b2bf2bd674fc16dedc7991044f81 /tests/ttk
parent4c618fd442a429c9c2ee4ab1c5ae13fe716eea30 (diff)
parentfd3ac0319439e3de2d7f6e97705fb1af1d66cdc4 (diff)
downloadtk-f229cc87ab8e94200976b0233cfe07e5887cea49.zip
tk-f229cc87ab8e94200976b0233cfe07e5887cea49.tar.gz
tk-f229cc87ab8e94200976b0233cfe07e5887cea49.tar.bz2
Merge trunk
Diffstat (limited to 'tests/ttk')
-rw-r--r--tests/ttk/combobox.test2
-rw-r--r--tests/ttk/entry.test4
-rw-r--r--tests/ttk/image.test2
-rw-r--r--tests/ttk/labelframe.test8
-rw-r--r--tests/ttk/notebook.test4
-rw-r--r--tests/ttk/panedwindow.test8
-rw-r--r--tests/ttk/progressbar.test2
-rw-r--r--tests/ttk/scrollbar.test2
-rw-r--r--tests/ttk/treetags.test2
-rw-r--r--tests/ttk/treeview.test34
-rw-r--r--tests/ttk/ttk.test36
11 files changed, 53 insertions, 51 deletions
diff --git a/tests/ttk/combobox.test b/tests/ttk/combobox.test
index ef77adb..48179f3 100644
--- a/tests/ttk/combobox.test
+++ b/tests/ttk/combobox.test
@@ -13,7 +13,7 @@ test combobox-1.0 "Combobox tests -- setup" -body {
test combobox-1.1 "Bad -values list" -body {
.cb configure -values "bad \{list"
-} -result "unmatched open brace in list" -returnCodes 1
+} -result "unmatched open brace in list" -returnCodes error
test combobox-1.end "Combobox tests -- cleanup" -body {
destroy .cb
diff --git a/tests/ttk/entry.test b/tests/ttk/entry.test
index 5eb4740..a958d90 100644
--- a/tests/ttk/entry.test
+++ b/tests/ttk/entry.test
@@ -7,6 +7,8 @@ package require tcltest 2.2
namespace import -force tcltest::*
loadTestedCommands
+testConstraint failsOnUbuntu [expr {![info exists ::env(TRAVIS_OS_NAME)] || ![string match linux $::env(TRAVIS_OS_NAME)]}]
+
variable scrollInfo
proc scroll args {
global scrollInfo
@@ -75,7 +77,7 @@ test entry-2.1 "Create entry before scrollbar" -body {
-expand false -fill x
} -cleanup {destroy .te .tsb}
-test entry-2.1.1 "Create entry before scrollbar - scrollbar catches up" -body {
+test entry-2.1.1 "Create entry before scrollbar - scrollbar catches up" -constraints failsOnUbuntu -body {
pack [ttk::entry .te -xscrollcommand [list .tsb set]] \
-expand true -fill both
.te insert end [string repeat "abc" 50]
diff --git a/tests/ttk/image.test b/tests/ttk/image.test
index ea0ab1d..bb593fc 100644
--- a/tests/ttk/image.test
+++ b/tests/ttk/image.test
@@ -12,7 +12,7 @@ test image-1.2 "Duplicate element" -setup {
ttk::style element create testElement image test.element
} -body {
ttk::style element create testElement image test.element
-} -returnCodes 1 -result "Duplicate element testElement"
+} -returnCodes error -result "Duplicate element testElement"
test image-2.0 "Deletion of displayed image (label)" -setup {
image create photo test.image -width 10 -height 10
diff --git a/tests/ttk/labelframe.test b/tests/ttk/labelframe.test
index 1f64d67..9ffffd8 100644
--- a/tests/ttk/labelframe.test
+++ b/tests/ttk/labelframe.test
@@ -11,22 +11,22 @@ test labelframe-2.1 "Can't use indirect descendant as labelwidget" -body {
ttk::frame .lf.t
ttk::checkbutton .lf.t.cb
.lf configure -labelwidget .lf.t.cb
-} -returnCodes 1 -result "can't *" -match glob \
+} -returnCodes error -result "can't *" -match glob \
-cleanup { destroy .lf.t } ;
test labelframe-2.2 "Can't use toplevel as labelwidget" -body {
toplevel .lf.t
.lf configure -labelwidget .lf.t
-} -returnCodes 1 -result "can't *" -match glob \
+} -returnCodes error -result "can't *" -match glob \
-cleanup { destroy .lf.t } ;
test labelframe-2.3 "Can't use non-windows as -labelwidget" -body {
.lf configure -labelwidget BogusWindowName
-} -returnCodes 1 -result {bad window path name "BogusWindowName"}
+} -returnCodes error -result {bad window path name "BogusWindowName"}
test labelframe-2.4 "Can't use nonexistent-windows as -labelwidget" -body {
.lf configure -labelwidget .nosuchwindow
-} -returnCodes 1 -result {bad window path name ".nosuchwindow"}
+} -returnCodes error -result {bad window path name ".nosuchwindow"}
###
diff --git a/tests/ttk/notebook.test b/tests/ttk/notebook.test
index fbab6bd..e58812a 100644
--- a/tests/ttk/notebook.test
+++ b/tests/ttk/notebook.test
@@ -25,11 +25,11 @@ test notebook-1.3 "Cannot add toplevel" -body {
.nb add [toplevel .nb.t]
} -cleanup {
destroy .t.nb
-} -returnCodes 1 -match glob -result "can't add .nb.t*"
+} -returnCodes error -match glob -result "can't add .nb.t*"
test notebook-1.4 "Try to select bad tab" -body {
.nb select @6000,6000
-} -returnCodes 1 -match glob -result "* not found"
+} -returnCodes error -match glob -result "* not found"
#
# Now add stuff:
diff --git a/tests/ttk/panedwindow.test b/tests/ttk/panedwindow.test
index 9d3cf77..528d56b 100644
--- a/tests/ttk/panedwindow.test
+++ b/tests/ttk/panedwindow.test
@@ -47,7 +47,7 @@ test panedwindow-1.7 "Make sure empty panedwindow still still doesn't crash" -bo
test panedwindow-1.8 "Re-forget pane" -body {
.pw forget .pw.f1
-} -returnCodes 1 -result ".pw.f1 is not managed by .pw"
+} -returnCodes error -result ".pw.f1 is not managed by .pw"
test panedwindow-1.end "Cleanup" -body {
destroy .pw
@@ -119,11 +119,11 @@ test panedwindow-3.0 "configure pane" -body {
test panedwindow-3.1 "configure pane -- errors" -body {
.pw pane 1 -weight -4
-} -returnCodes 1 -match glob -result "-weight must be nonnegative"
+} -returnCodes error -match glob -result "-weight must be nonnegative"
test panedwindow-3.2 "add pane -- errors" -body {
.pw add [ttk::label .pw.l] -weight -1
-} -returnCodes 1 -match glob -result "-weight must be nonnegative"
+} -returnCodes error -match glob -result "-weight must be nonnegative"
test panedwindow-3.end "cleanup" -body { destroy .pw }
@@ -147,7 +147,7 @@ test panedwindow-4.1 "forget" -body {
test panedwindow-4.2 "forget forgotten" -body {
.pw forget .pw.l1
-} -returnCodes 1 -result ".pw.l1 is not managed by .pw"
+} -returnCodes error -result ".pw.l1 is not managed by .pw"
# checkorder $winlist --
# Ensure that Y coordinates windows in $winlist are strictly increasing.
diff --git a/tests/ttk/progressbar.test b/tests/ttk/progressbar.test
index d3886e7..8e2fdb9 100644
--- a/tests/ttk/progressbar.test
+++ b/tests/ttk/progressbar.test
@@ -77,7 +77,7 @@ test progressbar-2.5 "error in write trace" -body {
trace variable PB w { error "YIPES!" ;# }
.pb step
set PB ;# NOTREACHED
-} -cleanup { unset PB } -returnCodes 1 -match glob -result "*YIPES!"
+} -cleanup { unset PB } -returnCodes error -match glob -result "*YIPES!"
test progressbar-end "Cleanup" -body {
destroy .pb
diff --git a/tests/ttk/scrollbar.test b/tests/ttk/scrollbar.test
index 2e49b27..75d11e7 100644
--- a/tests/ttk/scrollbar.test
+++ b/tests/ttk/scrollbar.test
@@ -124,7 +124,7 @@ test scale-1.0 "Self-destruction" -body {
ttk::scale .s -variable v
pack .s ; update
.s set 1 ; update
-} -returnCodes 1 -match glob -result "*"
+} -returnCodes error -match glob -result "*"
test scale-2.1 "-state option" -setup {
ttk::scale .s
diff --git a/tests/ttk/treetags.test b/tests/ttk/treetags.test
index 0de6df5..d7fa23a 100644
--- a/tests/ttk/treetags.test
+++ b/tests/ttk/treetags.test
@@ -171,7 +171,7 @@ test treetags-2.3 "Virtual events delivered to focus item" -body {
test treetags-2.4 "Bad events" -body {
$tv tag bind bad <Enter> { puts "Entered!" }
-} -returnCodes 1 -result "unsupported event <Enter>*" -match glob
+} -returnCodes error -result "unsupported event <Enter>*" -match glob
test treetags-3.0 "tag configure - set" -body {
$tv tag configure tag1 -foreground blue -background red
diff --git a/tests/ttk/treeview.test b/tests/ttk/treeview.test
index 522e3a8..8e31fe9 100644
--- a/tests/ttk/treeview.test
+++ b/tests/ttk/treeview.test
@@ -46,33 +46,33 @@ test treeview-1.1 "columns" -body {
test treeview-1.2 "Bad columns" -body {
#.tv configure -columns {illegal "list"value}
ttk::treeview .badtv -columns {illegal "list"value}
-} -returnCodes 1 -result "list element in quotes followed by*" -match glob
+} -returnCodes error -result "list element in quotes followed by*" -match glob
test treeview-1.3 "bad displaycolumns" -body {
.tv configure -displaycolumns {a b d}
-} -returnCodes 1 -result "Invalid column index d"
+} -returnCodes error -result "Invalid column index d"
test treeview-1.4 "more bad displaycolumns" -body {
.tv configure -displaycolumns {1 2 3}
-} -returnCodes 1 -result "Column index 3 out of bounds"
+} -returnCodes error -result "Column index 3 out of bounds"
test treeview-1.5 "Don't forget to check negative numbers" -body {
.tv configure -displaycolumns {1 -2 3}
-} -returnCodes 1 -result "Column index -2 out of bounds"
+} -returnCodes error -result "Column index -2 out of bounds"
# Item creation.
#
test treeview-2.1 "insert -- not enough args" -body {
.tv insert
-} -returnCodes 1 -result "wrong # args: *" -match glob
+} -returnCodes error -result "wrong # args: *" -match glob
test treeview-2.3 "insert -- bad integer index" -body {
.tv insert {} badindex
-} -returnCodes 1 -result "expected integer *" -match glob
+} -returnCodes error -result "expected integer *" -match glob
test treeview-2.4 "insert -- bad parent node" -body {
.tv insert badparent end
-} -returnCodes 1 -result "Item badparent not found" -match glob
+} -returnCodes error -result "Item badparent not found" -match glob
test treeview-2.5 "insert -- finaly insert a node" -body {
.tv insert {} end -id newnode -text "New node"
@@ -84,7 +84,7 @@ test treeview-2.6 "insert -- make sure node was inserted" -body {
test treeview-2.7 "insert -- prevent duplicate node names" -body {
.tv insert {} end -id newnode
-} -returnCodes 1 -result "Item newnode already exists"
+} -returnCodes error -result "Item newnode already exists"
test treeview-2.8 "insert -- new node at end" -body {
.tv insert {} end -id lastnode
@@ -126,7 +126,7 @@ test treeview-2.13 "insert -- one more at beginning" -body {
test treeview-2.14 "insert -- bad options" -body {
.tv insert {} end -badoption foo
-} -returnCodes 1 -result {unknown option "-badoption"}
+} -returnCodes error -result {unknown option "-badoption"}
test treeview-2.15 "insert -- at position 0 w/no children" -body {
.tv insert newnode 0 -id newnode.n2 -text "Foo"
@@ -202,7 +202,7 @@ test treeview-3.11 "Can't detach root item" -body {
.tv detach [list {}]
update
consistencyCheck .tv
-} -returnCodes 1 -result "Cannot detach root item"
+} -returnCodes error -result "Cannot detach root item"
consistencyCheck .tv
test treeview-3.12 "Reattach" -body {
@@ -275,7 +275,7 @@ test treeview-4.3 "opened - closed node" -body {
test treeview-5.1 "item -- error checks" -body {
.tv item newnode -text "Bad values" -values "{bad}list"
-} -returnCodes 1 -result "list element in braces followed by*" -match glob
+} -returnCodes error -result "list element in braces followed by*" -match glob
test treeview-5.2 "item -- error leaves options unchanged " -body {
.tv item newnode -text
@@ -298,11 +298,11 @@ test treeview-5.5 "set cell" -body {
test treeview-5.6 "set illegal cell" -body {
.tv set newnode #0 YYY
-} -returnCodes 1 -result "Display column #0 cannot be set"
+} -returnCodes error -result "Display column #0 cannot be set"
test treeview-5.7 "set illegal cell" -body {
.tv set newnode 3 YY ;# 3 == current #columns
-} -returnCodes 1 -result "Column index 3 out of bounds"
+} -returnCodes error -result "Column index 3 out of bounds"
test treeview-5.8 "set display columns" -body {
.tv configure -displaycolumns [list 2 1 0]
@@ -318,7 +318,7 @@ test treeview-5.9 "display columns part 2" -body {
test treeview-5.10 "cannot set column -id" -body {
.tv column #1 -id X
-} -returnCodes 1 -result "Attempt to change read-only option"
+} -returnCodes error -result "Attempt to change read-only option"
test treeview-5.11 "get" -body {
.tv set newnode #1
@@ -406,7 +406,7 @@ test treeview-7.1 "move" -body {
test treeview-7.2 "illegal move" -body {
.tv move d d2 end
-} -returnCodes 1 -result "Cannot insert d as descendant of d2"
+} -returnCodes error -result "Cannot insert d as descendant of d2"
test treeview-7.3 "illegal move has no effect" -body {
consistencyCheck .tv
@@ -427,7 +427,7 @@ test treeview-7.5 "replace children - precondition" -body {
test treeview-7.6 "Replace children - illegal move" -body {
.tv children newnode.n1 [list newnode.n1 newnode.n2 newnode.n3]
-} -returnCodes 1 -result "Cannot insert newnode.n1 as descendant of newnode.n1"
+} -returnCodes error -result "Cannot insert newnode.n1 as descendant of newnode.n1"
consistencyCheck .tv
@@ -458,7 +458,7 @@ test treeview-8.4 "Selection - clear" -body {
test treeview-8.5 "Selection - bad operation" -body {
.tv selection badop foo
-} -returnCodes 1 -match glob -result {bad selection operation "badop": must be *}
+} -returnCodes error -match glob -result {bad selection operation "badop": must be *}
test treeview-8.6 "Selection - <<TreeviewSelect>> on selection add" -body {
.tv selection set {}
diff --git a/tests/ttk/ttk.test b/tests/ttk/ttk.test
index ec1a3b6..fdd3eae 100644
--- a/tests/ttk/ttk.test
+++ b/tests/ttk/ttk.test
@@ -32,7 +32,7 @@ test ttk-6.1 "Self-destructing checkbutton" -body {
trace variable sd w [list selfdestruct .sd]
update
.sd invoke
-} -returnCodes 1
+} -returnCodes error
test ttk-6.2 "Checkbutton self-destructed" -body {
winfo exists .sd
} -result 0
@@ -146,7 +146,7 @@ test ttk-1.2 "Check style" -body {
test ttk-1.3 "Set bad style" -body {
.t configure -style "nosuchstyle"
-} -returnCodes 1 -result {Layout nosuchstyle not found}
+} -returnCodes error -result {Layout nosuchstyle not found}
test ttk-1.4 "Original style preserved" -body {
.t cget -style
@@ -235,11 +235,11 @@ foreach wc $widgetClasses {
# misc. error detection
test ttk-3.0 "Bad option" -body {
ttk::button .bad -badoption foo
-} -returnCodes 1 -result {unknown option "-badoption"} -match glob
+} -returnCodes error -result {unknown option "-badoption"} -match glob
test ttk-3.1 "Make sure widget command not created" -body {
.bad state disabled
-} -returnCodes 1 -result {invalid command name ".bad"} -match glob
+} -returnCodes error -result {invalid command name ".bad"} -match glob
test ttk-3.2 "Propagate errors from variable traces" -body {
set A 0
@@ -252,7 +252,7 @@ test ttk-3.2 "Propagate errors from variable traces" -body {
test ttk-3.3 "Constructor failure with cursor" -body {
ttk::button .b -cursor bottom_right_corner -style BadStyle
-} -returnCodes 1 -result "Layout BadStyle not found"
+} -returnCodes error -result "Layout BadStyle not found"
test ttk-3.4 "SF#2009213" -body {
ttk::style configure TScale -sliderrelief {}
@@ -388,12 +388,12 @@ test ttk-8.4 "ImageChanged" -body {
test ttk-9.1 "Traces on nonexistant namespaces" -body {
ttk::checkbutton .tcb -variable foo::bar
-} -returnCodes 1 -result "*parent namespace doesn't exist*" -match glob
+} -returnCodes error -result "*parent namespace doesn't exist*" -match glob
test ttk-9.2 "Traces on nonexistant namespaces II" -body {
ttk::checkbutton .tcb -variable X
.tcb configure -variable foo::bar
-} -returnCodes 1 -result "*parent namespace doesn't exist*" -match glob
+} -returnCodes error -result "*parent namespace doesn't exist*" -match glob
test ttk-9.3 "Restore saved options on configure error" -body {
.tcb cget -variable
@@ -458,7 +458,7 @@ test ttk-10.3 "Check class resource" -body {
test ttk-10.4 "Try to modify class resource" -body {
.f configure -class Bar
-} -returnCodes 1 -match glob -result "*read-only option*"
+} -returnCodes error -match glob -result "*read-only option*"
test ttk-10.5 "Check class resource again" -body {
.f cget -class
@@ -548,14 +548,14 @@ test ttk-12.4 "-borderwidth frame option" -body {
test ttk-13.1 "Custom styles -- bad -style option" -body {
ttk::button .tb1 -style badstyle
-} -returnCodes 1 -result "*badstyle not found*" -match glob
+} -returnCodes error -result "*badstyle not found*" -match glob
test ttk-13.4 "Custom styles -- bad -style option" -body {
ttk::button .tb1
.tb1 configure -style badstyle
} -cleanup {
destroy .tb1
-} -returnCodes 1 -result "*badstyle not found*" -match glob
+} -returnCodes error -result "*badstyle not found*" -match glob
test ttk-13.5 "Custom layouts -- missing element definition" -body {
ttk::style layout badstyle {
@@ -573,17 +573,17 @@ test ttk-13.5 "Custom layouts -- missing element definition" -body {
test ttk-14.1 "-variable in nonexistant namespace" -body {
ttk::checkbutton .tw -variable ::nsn::foo
-} -returnCodes 1 -result {can't trace *: parent namespace doesn't exist} \
+} -returnCodes error -result {can't trace *: parent namespace doesn't exist} \
-match glob -cleanup { destroy .tw }
test ttk-14.2 "-textvariable in nonexistant namespace" -body {
ttk::label .tw -textvariable ::nsn::foo
-} -returnCodes 1 -result {can't trace *: parent namespace doesn't exist} \
+} -returnCodes error -result {can't trace *: parent namespace doesn't exist} \
-match glob -cleanup { destroy .tw }
test ttk-14.3 "-textvariable in nonexistant namespace" -body {
ttk::entry .tw -textvariable ::nsn::foo
-} -returnCodes 1 -result {can't trace *: parent namespace doesn't exist} \
+} -returnCodes error -result {can't trace *: parent namespace doesn't exist} \
-match glob -cleanup { destroy .tw }
test ttk-15.1 {Bug 3062331} -setup {
@@ -629,27 +629,27 @@ proc wrong#varargs {varpart args} {
test ttk-ensemble-0 "style element create: insufficient args" -body {
ttk::style
-} -returnCodes 1 -result \
+} -returnCodes error -result \
[wrong#varargs arg ttk::style option]
test ttk-ensemble-1 "style element create: insufficient args" -body {
ttk::style element
-} -returnCodes 1 -result \
+} -returnCodes error -result \
[wrong#varargs arg ttk::style element option]
test ttk-ensemble-2 "style element create: insufficient args" -body {
ttk::style element create
-} -returnCodes 1 -result \
+} -returnCodes error -result \
[wrong#varargs {-option value} ttk::style element create name type]
test ttk-ensemble-3 "style element create: insufficient args" -body {
ttk::style element create plain.background
-} -returnCodes 1 -result \
+} -returnCodes error -result \
[wrong#varargs {-option value} ttk::style element create name type]
test ttk-ensemble-4 "style element create: insufficient args" -body {
ttk::style element create plain.background from
-} -returnCodes 1 -result [wrong#args theme ?element?]
+} -returnCodes error -result [wrong#args theme ?element?]
test ttk-ensemble-5 "style element create: valid" -body {
ttk::style element create plain.background from default