diff options
author | aniap <aniap> | 2008-08-03 15:28:53 (GMT) |
---|---|---|
committer | aniap <aniap> | 2008-08-03 15:28:53 (GMT) |
commit | 7aabd0cfee1e2b57ca97b2e224447a05fb4424b7 (patch) | |
tree | c3554fa38a9fb9dd63c67410e4d858acd3e80c38 /tests/get.test | |
parent | 365b6adca04ac915380389350871d557246f1074 (diff) | |
download | tk-7aabd0cfee1e2b57ca97b2e224447a05fb4424b7.zip tk-7aabd0cfee1e2b57ca97b2e224447a05fb4424b7.tar.gz tk-7aabd0cfee1e2b57ca97b2e224447a05fb4424b7.tar.bz2 |
Update to tcltest2
Diffstat (limited to 'tests/get.test')
-rw-r--r-- | tests/get.test | 134 |
1 files changed, 97 insertions, 37 deletions
diff --git a/tests/get.test b/tests/get.test index 66c5d1e..dd09f15 100644 --- a/tests/get.test +++ b/tests/get.test @@ -6,75 +6,135 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: get.test,v 1.5 2004/05/23 17:34:48 dkf Exp $ +# RCS: @(#) $Id: get.test,v 1.6 2008/08/03 15:28:53 aniap Exp $ -package require tcltest 2.1 +package require tcltest 2.2 eval tcltest::configure $argv tcltest::loadTestedCommands +namespace import -force tcltest::test -button .b -test get-1.1 {Tk_GetAnchorFromObj} { +test get-1.1 {Tk_GetAnchorFromObj} -setup { + button .b +} -body { .b configure -anchor n .b cget -anchor -} {n} -test get-1.2 {Tk_GetAnchorFromObj} { +} -cleanup { + destroy .b +} -result {n} +test get-1.2 {Tk_GetAnchorFromObj} -setup { + button .b +} -body { .b configure -anchor ne .b cget -anchor -} {ne} -test get-1.3 {Tk_GetAnchorFromObj} { +} -cleanup { + destroy .b +} -result {ne} +test get-1.3 {Tk_GetAnchorFromObj} -setup { + button .b +} -body { .b configure -anchor e .b cget -anchor -} {e} -test get-1.4 {Tk_GetAnchorFromObj} { +} -cleanup { + destroy .b +} -result {e} +test get-1.4 {Tk_GetAnchorFromObj} -setup { + button .b +} -body { .b configure -anchor se .b cget -anchor -} {se} -test get-1.5 {Tk_GetAnchorFromObj} { +} -cleanup { + destroy .b +} -result {se} +test get-1.5 {Tk_GetAnchorFromObj} -setup { + button .b +} -body { .b configure -anchor s .b cget -anchor -} {s} -test get-1.6 {Tk_GetAnchorFromObj} { +} -cleanup { + destroy .b +} -result {s} +test get-1.6 {Tk_GetAnchorFromObj} -setup { + button .b +} -body { .b configure -anchor sw .b cget -anchor -} {sw} -test get-1.7 {Tk_GetAnchorFromObj} { +} -cleanup { + destroy .b +} -result {sw} +test get-1.7 {Tk_GetAnchorFromObj} -setup { + button .b +} -body { .b configure -anchor w .b cget -anchor -} {w} -test get-1.8 {Tk_GetAnchorFromObj} { +} -cleanup { + destroy .b +} -result {w} +test get-1.8 {Tk_GetAnchorFromObj} -setup { + button .b +} -body { .b configure -anchor nw .b cget -anchor -} {nw} -test get-1.9 {Tk_GetAnchorFromObj} { +} -cleanup { + destroy .b +} -result {nw} +test get-1.9 {Tk_GetAnchorFromObj} -setup { + button .b +} -body { .b configure -anchor n .b cget -anchor -} {n} -test get-1.10 {Tk_GetAnchorFromObj} { +} -cleanup { + destroy .b +} -result {n} +test get-1.10 {Tk_GetAnchorFromObj} -setup { + button .b +} -body { .b configure -anchor center .b cget -anchor -} {center} -test get-1.11 {Tk_GetAnchorFromObj - error} { - list [catch {.b configure -anchor unknown} msg] $msg -} {1 {bad anchor "unknown": must be n, ne, e, se, s, sw, w, nw, or center}} +} -cleanup { + destroy .b +} -result {center} +test get-1.11 {Tk_GetAnchorFromObj - error} -setup { + button .b +} -body { + .b configure -anchor unknown +} -cleanup { + destroy .b +} -returnCodes {error} -result {bad anchor "unknown": must be n, ne, e, se, s, sw, w, nw, or center} -catch {destroy .b} -button .b -test get-2.1 {Tk_GetJustifyFromObj} { + +test get-2.1 {Tk_GetJustifyFromObj} -setup { + button .b +} -body { .b configure -justify left .b cget -justify -} {left} -test get-2.2 {Tk_GetJustifyFromObj} { +} -cleanup { + destroy .b +} -result {left} +test get-2.2 {Tk_GetJustifyFromObj} -setup { + button .b +} -body { .b configure -justify right .b cget -justify -} {right} -test get-2.3 {Tk_GetJustifyFromObj} { +} -cleanup { + destroy .b +} -result {right} +test get-2.3 {Tk_GetJustifyFromObj} -setup { + button .b +} -body { .b configure -justify center .b cget -justify -} {center} -test get-2.4 {Tk_GetJustifyFromObj - error} { - list [catch {.b configure -justify stupid} msg] $msg -} {1 {bad justification "stupid": must be left, right, or center}} +} -cleanup { + destroy .b +} -result {center} +test get-2.4 {Tk_GetJustifyFromObj - error} -setup { + button .b +} -body { + .b configure -justify stupid +} -cleanup { + destroy .b +} -returnCodes {error} -result {bad justification "stupid": must be left, right, or center} # cleanup cleanupTests return + |