From 08933a2f8b133e34a85d24c6673cc98f383f22d9 Mon Sep 17 00:00:00 2001 From: treectrl Date: Tue, 29 Mar 2005 20:40:24 +0000 Subject: Removed package_require hack. Use "-match glob" to simplify some tests. --- tests/column.test | 10 +++++----- tests/item.test | 16 ++++++++-------- tests/style.test | 6 +++--- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/tests/column.test b/tests/column.test index 3628fb9..ac3265e 100644 --- a/tests/column.test +++ b/tests/column.test @@ -10,7 +10,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# CVS: @(#) $Id: column.test,v 1.4 2004/07/26 17:33:14 treectrl Exp $ +# CVS: @(#) $Id: column.test,v 1.5 2005/03/29 20:40:24 treectrl Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest 2 @@ -18,7 +18,7 @@ if {[lsearch [namespace children] ::tcltest] == -1} { } package require Tk -package_require treectrl +package require treectrl test column-0.1 {some needed preparations} -body { pack [treectrl .t] @@ -34,7 +34,7 @@ test column-1.1 {missing args} -body { test column-1.2 {unknown command} -body { .t column foo -} -returnCodes error -result {bad command "foo": must be bbox, cget, configure, create, delete, index, move, neededwidth, or width} +} -returnCodes error -result {bad command "foo": must be *} -match glob test column-1.3 {configure: no column exists with numerical index} -body { .t column configure 0 @@ -92,11 +92,11 @@ test column-3.2 {column configure: invalid column} -body { test column-3.3 {column configure: list all options} -body { .t column configure column1 -} -result {{-arrow {} {} none none} {-arrowside {} {} right right} {-arrowgravity {} {} left left} {-arrowpad {} {} 6 6} {-bitmap {} {} {} {}} {-background {} {} #d9d9d9 #d9d9d9} {-borderwidth {} {} 2 2} {-button {} {} 1 1} {-expand {} {} 0 0} {-font {} {} {} {}} {-image {} {} {} {}} {-imagepadx {} {} 6 6} {-imagepady {} {} 0 0} {-itembackground {} {} {} {}} {-justify {} {} left left} {-minwidth {} {} {} {}} {-relief {} {} raised raised} {-stepwidth {} {} {} {}} {-sunken {} {} 0 0} {-tag {} {} {} column1} {-text {} {} {} {}} {-textcolor {} {} Black Black} {-textpadx {} {} 6 6} {-textpady {} {} 0 0} {-width {} {} {} {}} {-visible {} {} 1 1} {-widthhack {} {} 0 0}} +} -result {{-arrow {} {} none none} *} -match glob test column-3.4 {column configure: tail column} -body { .t column configure tail -} -result {{-arrow {} {} none none} {-arrowside {} {} right right} {-arrowgravity {} {} left left} {-arrowpad {} {} 6 6} {-bitmap {} {} {} {}} {-background {} {} #d9d9d9 #d9d9d9} {-borderwidth {} {} 2 2} {-button {} {} 1 1} {-expand {} {} 0 0} {-font {} {} {} {}} {-image {} {} {} {}} {-imagepadx {} {} 6 6} {-imagepady {} {} 0 0} {-itembackground {} {} {} {}} {-justify {} {} left left} {-minwidth {} {} {} {}} {-relief {} {} raised raised} {-stepwidth {} {} {} {}} {-sunken {} {} 0 0} {-tag {} {} {} tail} {-text {} {} {} {}} {-textcolor {} {} Black Black} {-textpadx {} {} 6 6} {-textpady {} {} 0 0} {-width {} {} {} {}} {-visible {} {} 1 1} {-widthhack {} {} 0 0}} +} -result {{-arrow {} {} none none} *} -match glob test column-3.5 {column configure: invalid -arrow} -body { .t column configure column1 -arrow straight diff --git a/tests/item.test b/tests/item.test index 2d648b5..2149a63 100644 --- a/tests/item.test +++ b/tests/item.test @@ -10,7 +10,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# CVS: @(#) $Id: item.test,v 1.8 2004/07/30 21:22:55 treectrl Exp $ +# CVS: @(#) $Id: item.test,v 1.9 2005/03/29 20:41:08 treectrl Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest 2 @@ -18,7 +18,7 @@ if {[lsearch [namespace children] ::tcltest] == -1} { } package require Tk -package_require treectrl +package require treectrl test item-0.1 {some needed preparations} -body { pack [treectrl .t] @@ -30,7 +30,7 @@ test item-1.1 {item: missing command} -body { test item-2.2 {item: invalid command} -body { .t item foo -} -returnCodes error -result {bad command "foo": must be ancestors, children, create, delete, firstchild, lastchild, nextsibling, numchildren, parent, prevsibling, remove, bbox, cget, complex, configure, dump, element, index, isancestor, isopen, rnc, sort, state, style, or text} +} -returnCodes error -result {bad command "foo": must be *} -match glob # Before continuing to test the item descriptions and their modifiers, # lets create some items with this hierarchy: @@ -210,7 +210,7 @@ test item-14.1 {item element: missing command} -body { test item-14.2 {item element: invalid command} -body { .t item element foo 8 0 eText -} -returnCodes error -result {bad command "foo": must be actual, cget, or configure} +} -returnCodes error -result {bad command "foo": must be *} -match glob test item-14.3 {item element actual: missing arg} -body { .t item element actual 8 0 eText @@ -247,11 +247,11 @@ test item-15.1 {item style: missing args} -body { test item-15.2 {item style: invalid command} -body { .t item style foo bar -} -returnCodes error -result {bad command "foo": must be elements, map, or set} +} -returnCodes error -result {bad command "foo": must be *} -match glob test item-15.3 {item style: invalid command} -body { .t item style foo bar -} -returnCodes error -result {bad command "foo": must be elements, map, or set} +} -returnCodes error -result {bad command "foo": must be *} -match glob test item-15.4 {item style elements: missing args} -body { .t item style elements 8 @@ -333,7 +333,7 @@ test item-16.1 {item state: missing args} -body { test item-16.2 {item state: unknown command} -body { .t item state foo bar -} -returnCodes error -result {bad command "foo": must be get or set} +} -returnCodes error -result {bad command "foo": must be *} -match glob test item-16.3 {item state get: unknown item} -body { .t item state get 999 @@ -439,7 +439,7 @@ test item-17.3 {item sort: is all allowed?} -body { test item-17.4 {item sort: invalid option} -body { .t item sort root -foo -} -returnCodes error -result {bad option "-foo": must be -ascii, -column, -command, -decreasing, -dictionary, -element, -first, -increasing, -integer, -last, -notreally, or -real} +} -returnCodes error -result {bad option "-foo": must be *} -match glob test item-17.5 {item sort: missing arg to an option} -body { .t item sort root -first diff --git a/tests/style.test b/tests/style.test index e3bf752..4a8d4e1 100644 --- a/tests/style.test +++ b/tests/style.test @@ -10,7 +10,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# CVS: @(#) $Id: style.test,v 1.3 2004/07/30 21:22:56 treectrl Exp $ +# CVS: @(#) $Id: style.test,v 1.4 2005/03/29 20:41:41 treectrl Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest 2 @@ -18,7 +18,7 @@ if {[lsearch [namespace children] ::tcltest] == -1} { } package require Tk -package_require treectrl +package require treectrl test style-0.1 {some needed preparations} -body { pack [treectrl .t] @@ -38,7 +38,7 @@ test style-1.1 {style: missing args} -body { test style-1.2 {style: invalid command} -body { .t style foo -} -returnCodes error -result {bad command "foo": must be cget, configure, create, delete, elements, layout, or names} +} -returnCodes error -result {bad command "foo": must be *} -match glob test style-1.3 {style names: no style exists yet} -body { .t style names -- cgit v0.12