1 # This file is a Tcl script to test out [incr Widgets] Hyperhelp class.
2 # It is organized in the standard fashion for Tcl tests with the following
3 # notation for test case labels:
5 # 1.x - Construction/Destruction tests
6 # 2.x - Configuration option tests
9 # Copyright (c) 1995 DSC Technologies Corporation
11 # See the file "license.terms" for information on usage and redistribution
12 # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
14 # @(#) $Id: hyperhelp.test
16 package require Iwidgets 3.0
18 if {[string compare test [info procs test]] == 1} {
27 # Initial construction test
29 test Hyperhelp-1.$c {Hyperhelp construction} {
30 iwidgets::Hyperhelp .h
39 # Option tests which are successful.
41 test Hyperhelp-2.$o {configuration option} {
42 llength [.h configure]
47 foreach test [concat {
48 {-activebackground #ececec #ececec}
49 {-activeforeground Black Black}
50 {-activerelief raised raised}
51 {-background #d9d9d9 #d9d9d9}
54 {-font -Adobe-Helvetica-Bold-R-Normal--*-120-*-*-*-*-*-* \
55 -Adobe-Helvetica-Bold-R-Normal--*-120-*-*-*-*-*-*}
56 {-foreground Black Black}
57 {-highlightcolor Black Black}
58 {-highlightthickness 3 3}
61 {-relief raised raised}
62 {-relief sunken sunken}
63 {-vscrollmode none none}
64 {-vscrollmode static static}
65 {-vscrollmode dynamic dynamic}
66 {-hscrollmode none none}
67 {-hscrollmode static static}
68 {-hscrollmode dynamic dynamic}
71 {-selectborderwidth 2 2}
72 {-textbackground GhostWhite GhostWhite}
73 {-visibleitems 72x40 72x40}
80 {-linkhighlight red red}
81 {-fontname times times}
82 {-fixedfont courier courier}
83 {-fontsize medium medium}
85 {-title "Test" "Test"} } \
86 [list [list -helpdir . [pwd]/.]]] {
87 set option [lindex $test 0]
88 test Hyperhelp-2.$o "configuration options, $option" {
89 .h configure $option [lindex $test 1]
90 lindex [.h configure $option] 4
97 # Option tests which fail and produce errors.
100 {-visibleitems bogus {bad visibleitems option "bogus": should be widthxheight}}
101 {-hscrollmode bogus {bad hscrollmode option "bogus": should be static, dynamic, or none}}
102 {-vscrollmode bogus {bad vscrollmode option "bogus": should be static, dynamic, or none}}
103 {-fontname bogus {Invalid font name "bogus". Must be one of helvetica courier times symbol}}
104 {-fontsize bogus {bad fontsize option "bogus": should be small, medium, large, or huge}}
105 {-fixedfont bogus {Invalid font name "bogus". Must be one of helvetica courier times symbol}}} {
106 set option [lindex $test 0]
107 test Hyperhelp-2.$o "configuration options, $option" {
108 list [catch {.h configure $option [lindex $test 1]} msg] $msg
109 } [list 1 [lindex $test 2]]
114 # Method tests which are successful.
117 {{.h showtopic hyperhelp} -1}
118 {{.h followlink scrolledhtml.test#} -1}
121 set method [lindex [lindex $test 0] 1]
122 test Hyperhelp-3.$m "object methods, $method" {
123 list [catch {eval [lindex $test 0]} msg] $msg
124 } [list 0 [lindex $test 1]]
130 # Conclusion of construction/destruction tests
132 test Hyperhelp-1.$c {Hyperhelp destruction} {
139 test Hyperhelp-1.$c {Hyperhelp construction} {
140 iwidgets::hyperhelp .h -topics {index} -helpdir ~/public_html
148 test Hyperhelp-1.$c {Hyperhelp destruction} {
155 test Hyperhelp-1.$c {Hyperhelp destruction} {
156 iwidgets::hyperhelp .h