#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
-
-if {[info commands testfont] != "testfont"} {
- puts "testfont command not available; skipping tests"
- ::tcltest::cleanupTests
- return
-}
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
catch {destroy .b}
toplevel .b
test font-14.1 {Tk_GetFont procedure} {
} {}
-test font-15.1 {Tk_AllocFontFromObj - converting internal reps} {
+test font-15.1 {Tk_AllocFontFromObj - converting internal reps} testfont {
set x {Times 16}
lindex $x 0
destroy .b1 .b2
lindex $x 0
testfont counts {Times 16}
} {{1 0}}
-test font-15.2 {Tk_AllocFontFromObj - discard stale font} {
+test font-15.2 {Tk_AllocFontFromObj - discard stale font} testfont {
set x {Times 16}
destroy .b1 .b2
button .b1 -font $x
button .b2 -font $x
lappend result [testfont counts {Times 16}]
} {{} {{1 1}}}
-test font-15.3 {Tk_AllocFontFromObj - reuse existing font} {
+test font-15.3 {Tk_AllocFontFromObj - reuse existing font} testfont {
set x {Times 16}
destroy .b1 .b2
button .b1 -font $x
.b.f cget -font
} {-family fixed}
-test font-17.1 {Tk_FreeFontFromObj - reference counts} {
+test font-17.1 {Tk_FreeFontFromObj - reference counts} testfont {
set x {Courier 12}
destroy .b1 .b2 .b3
button .b1 -font $x
list [lindex [font actual xyz] 0] [lindex $x 0]
} {-family -family}
-test font-18.1 {FreeFontObjProc} {
+test font-18.1 {FreeFontObjProc} testfont {
destroy .b1
set x [format {Courier 12}]
button .b1 -font $x
.b.c insert text end "end"
set x [.b.c postscript]
set i [string first "(qwerty" $x]
- string range $x $i [expr {$i + 213}]
-} {(qwertyuiopasdfghjklzxcvbnm1234qwertyuiopasdfghjklzxcvbnm)
-(qwertyuiopasdfghjklzxcvbnm1234qwertyuiopasdfghjklzxcvbnm)
-()
-()
-()
-()
-()
-()
-()
-()
-()
-()
-()
-()
-()
-()
-()
-()
-()
-()
-()
-()
-()
-()
-()
-()
-()
-()
-()
-()
-()
-()
-(end)
+ string range $x $i [expr {$i + 278}]
+} {(qwertyuiopasdfghjklzxcvbnm1234qwertyuiopasdfghjklzxcvbnm)]
+[(qwertyuiopasdfghjklzxcvbnm1234qwertyuiopasdfghjklzxcvbnm)]
+[()]
+[()]
+[()]
+[()]
+[()]
+[()]
+[()]
+[()]
+[()]
+[()]
+[()]
+[()]
+[()]
+[()]
+[()]
+[()]
+[()]
+[()]
+[()]
+[()]
+[()]
+[()]
+[()]
+[()]
+[()]
+[()]
+[()]
+[()]
+[()]
+[()]
+[(end)]
}
test font-33.1 {Tk_TextWidth procedure} {
-