diff options
Diffstat (limited to 'tests/unixFont.test')
| -rw-r--r-- | tests/unixFont.test | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/tests/unixFont.test b/tests/unixFont.test index aae6d9c..b97a607 100644 --- a/tests/unixFont.test +++ b/tests/unixFont.test @@ -16,6 +16,9 @@ package require tcltest 2.2 eval tcltest::configure $argv tcltest::loadTestedCommands +# Import utility procs for specific functional areas +testutils import geometry + if {[tk windowingsystem] eq "x11"} { if {[testConstraint withXft]} { set fontsystemcmd [auto_execok fc-list] @@ -71,10 +74,6 @@ set cx [font measure TkFixedFont 0] set ax [winfo reqwidth .b.l] set ay [winfo reqheight .b.l] -proc getsize {} { - update - return "[winfo reqwidth .b.l] [winfo reqheight .b.l]" -} test unixfont-1.1 {TkpGetNativeFont procedure: not native} {x11} { list [catch {font measure {} xyz} msg] $msg @@ -121,9 +120,6 @@ test unixfont-2.7 {TkpGetFontFromAttributes: fixed family not available!} x11 { test unixfont-2.8 {TkpGetFontFromAttributes: loop over returned font names} {x11 haveFixedFamilyFont} { lindex [font actual {-family fixed -size 31}] 1 } {fixed} -test unixfont-2.9 {TkpGetFontFromAttributes: reject adobe courier if possible} {x11 haveCourierFamilyFont} { - lindex [font actual {-family courier}] 1 -} {courier} test unixfont-2.10 {TkpGetFontFromAttributes: scalable font found} {x11 havePointsize37Font} { lindex [font actual {-family courier -size 37}] 3 } 37 @@ -162,23 +158,23 @@ test unixfont-5.3 {Tk_MeasureChars procedure: loop over chars} x11 { .b.l config -wrap [expr $ax*10] test unixfont-5.4 {Tk_MeasureChars procedure: reached right edge} x11 { .b.l config -text "0000000000000" - getsize + getsize .b.l } "[expr $ax*10] [expr $ay*2]" test unixfont-5.5 {Tk_MeasureChars procedure: ran out of chars} x11 { .b.l config -text "000000" - getsize + getsize .b.l } "[expr $ax*6] $ay" test unixfont-5.6 {Tk_MeasureChars procedure: find last word} x11 { .b.l config -text "000000 00000" - getsize + getsize .b.l } "[expr $ax*6] [expr $ay*2]" test unixfont-5.7 {Tk_MeasureChars procedure: already saw space in line} x11 { .b.l config -text "000000 00000" - getsize + getsize .b.l } "[expr $ax*6] [expr $ay*2]" test unixfont-5.8 {Tk_MeasureChars procedure: internal spaces significant} {x11} { .b.l config -text "00 000 00000" - getsize + getsize .b.l } "[expr $ax*7] [expr $ay*2]" test unixfont-5.9 {Tk_MeasureChars procedure: TK_PARTIAL_OK} {x11} { .b.c dchars $t 0 end @@ -187,18 +183,18 @@ test unixfont-5.9 {Tk_MeasureChars procedure: TK_PARTIAL_OK} {x11} { } 2 test unixfont-5.10 {Tk_MeasureChars procedure: TK_AT_LEAST_ONE} x11 { .b.l config -text "000000000000" - getsize + getsize .b.l } "[expr $ax*10] [expr $ay*2]" test unixfont-5.11 {Tk_MeasureChars: TK_AT_LEAST_ONE + not even one char fit!} x11 { set a [.b.l cget -wrap] .b.l config -text "000000" -wrap 1 - set x [getsize] + set x [getsize .b.l] .b.l config -wrap $a set x } "$ax [expr $ay*6]" test unixfont-5.12 {Tk_MeasureChars procedure: include eol spaces} {x11} { .b.l config -text "000 \n000" - getsize + getsize .b.l } "[expr $ax*6] [expr $ay*2]" test unixfont-6.1 {Tk_DrawChars procedure: loop test} x11 { @@ -332,6 +328,10 @@ test unixfont-9.2 {4 chars substituted in inserted text} {x11 nonPortable} { lappend x [.b.c index $t @[expr $ax*5],0] } {0 1 1 1 1 2} -# cleanup +# +# CLEANUP +# + +testutils forget geometry cleanupTests return |
