1# This file is a Tcl script to test out the procedures in the file
2# tkGet.c.  It is organized in the standard fashion for Tcl
3# white-box tests.
4#
5# Copyright (c) 1998 Sun Microsystems, Inc.
6# Copyright (c) 1998-1999 by Scriptics Corporation.
7# All rights reserved.
8#
9# RCS: @(#) $Id$
10
11package require tcltest 2.1
12eval tcltest::configure $argv
13tcltest::loadTestedCommands
14
15button .b
16test get-1.1 {Tk_GetAnchorFromObj} {
17    .b configure -anchor n
18    .b cget -anchor
19} {n}
20test get-1.2 {Tk_GetAnchorFromObj} {
21    .b configure -anchor ne
22    .b cget -anchor
23} {ne}
24test get-1.3 {Tk_GetAnchorFromObj} {
25    .b configure -anchor e
26    .b cget -anchor
27} {e}
28test get-1.4 {Tk_GetAnchorFromObj} {
29    .b configure -anchor se
30    .b cget -anchor
31} {se}
32test get-1.5 {Tk_GetAnchorFromObj} {
33    .b configure -anchor s
34    .b cget -anchor
35} {s}
36test get-1.6 {Tk_GetAnchorFromObj} {
37    .b configure -anchor sw
38    .b cget -anchor
39} {sw}
40test get-1.7 {Tk_GetAnchorFromObj} {
41    .b configure -anchor w
42    .b cget -anchor
43} {w}
44test get-1.8 {Tk_GetAnchorFromObj} {
45    .b configure -anchor nw
46    .b cget -anchor
47} {nw}
48test get-1.9 {Tk_GetAnchorFromObj} {
49    .b configure -anchor n
50    .b cget -anchor
51} {n}
52test get-1.10 {Tk_GetAnchorFromObj} {
53    .b configure -anchor center
54    .b cget -anchor
55} {center}
56test get-1.11 {Tk_GetAnchorFromObj - error} {
57    list [catch {.b configure -anchor unknown} msg] $msg
58} {1 {bad anchor "unknown": must be n, ne, e, se, s, sw, w, nw, or center}}
59
60catch {destroy .b}
61button .b
62test get-2.1 {Tk_GetJustifyFromObj} {
63    .b configure -justify left
64    .b cget -justify
65} {left}
66test get-2.2 {Tk_GetJustifyFromObj} {
67    .b configure -justify right
68    .b cget -justify
69} {right}
70test get-2.3 {Tk_GetJustifyFromObj} {
71    .b configure -justify center
72    .b cget -justify
73} {center}
74test get-2.4 {Tk_GetJustifyFromObj - error} {
75    list [catch {.b configure -justify stupid} msg] $msg
76} {1 {bad justification "stupid": must be left, right, or center}}
77
78# cleanup
79cleanupTests
80return
81