File: disjointlistbox.test

package info (click to toggle)
itcl3.0 3.0.1-6
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 10,128 kB
  • ctags: 3,519
  • sloc: tcl: 32,416; ansic: 12,683; sh: 3,917; makefile: 692; awk: 273; perl: 265
file content (98 lines) | stat: -rw-r--r-- 2,166 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# This file is a Tcl script to test out [incr Widgets] Disjointlistbox class.
# It is organized in the standard fashion for Tcl tests with the following
# notation for test case labels:
#
#   1.x - Construction/Destruction tests
#   2.x - Configuration option tests
#   3.x - Method tests
#
# Copyright (c) 1995 DSC Technologies Corporation
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
# @(#) $Id: disjointlistbox.test,v 1.2 1996/07/12 16:55:30 mulferts Exp $

package require Iwidgets 3.0

if {[string compare test [info procs test]] == 1} {
    source defs
}

wm geometry . {}
raise .

set c 1
set o 1
set m 1

#
# Initial construction test
#
test Disjointlistbox-1.$c {Disjointlistbox construction} {
    iwidgets::Disjointlistbox .lf
    pack .lf -fill both -expand yes
    update 
} {}

incr c

#
# Option tests which are successful.
#
test Disjointlistbox-2.$o {configuration option} {
    llength [.lf configure]
} {28}

incr o

foreach test {
    {-lhslabeltext "LHS" "LHS"}
    {-lhslabeltext "Available" "Available"}
    {-lhslabeltext "Don't Print" "Don't Print"}
    {-rhslabeltext "RHS" "RHS"}
    {-rhslabeltext "Current" "Current"}
    {-rhslabeltext "Print" "Print"}
    {-buttonplacement bottom bottom}
    {-buttonplacement center center}
    } {
	set option [lindex $test 0]
	test Disjointlistbox-1.$o "configuration options, $option" {
	    .lf configure $option [lindex $test 1]
	    lindex [.lf configure $option] 4
	} [lindex $test 2]
        update 
	incr o
    }

#
# Method tests which are successful.
#
test Disjointlistbox-1.$c {Disjointlistbox destruction} {
    destroy .lf
    update 
} {}

incr c

test Disjointlistbox-1.$c {Disjointlistbox construction} {
    iwidgets::disjointlistbox .lf -lhslabeltext "Don't Print" -rhslabeltext "Print"
    pack .lf -fill both -expand yes
    update 
} {}

incr c

test Disjointlistbox-1.$c {Disjointlistbox destruction} {
    destroy .lf
    update 
} {}

incr c

test Disjointlistbox-1.$c {Disjointlistbox construction} {
    iwidgets::disjointlistbox .lf 
    pack .lf 
    destroy .lf
    update 
} {}