diff options
author | patthoyts <patthoyts@users.sourceforge.net> | 2007-11-17 21:28:05 (GMT) |
---|---|---|
committer | patthoyts <patthoyts@users.sourceforge.net> | 2007-11-17 21:28:05 (GMT) |
commit | 6cb937528ddf86aca32fbae1af99b6b4ab59653d (patch) | |
tree | aba921a5e65aceda64cb68ca883d80d542fae88b /tests/font.test | |
parent | 47bb49fb410bdc4333931805c2c3df2192d604c3 (diff) | |
download | tk-6cb937528ddf86aca32fbae1af99b6b4ab59653d.zip tk-6cb937528ddf86aca32fbae1af99b6b4ab59653d.tar.gz tk-6cb937528ddf86aca32fbae1af99b6b4ab59653d.tar.bz2 |
Only check for -displayof if there are sufficient arguments. This permits checking strings like -d.
Diffstat (limited to 'tests/font.test')
-rw-r--r-- | tests/font.test | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/tests/font.test b/tests/font.test index 3dce0f7..4627396 100644 --- a/tests/font.test +++ b/tests/font.test @@ -6,7 +6,7 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: font.test,v 1.15 2007/04/24 15:54:30 hobbs Exp $ +# RCS: @(#) $Id: font.test,v 1.16 2007/11/17 21:28:05 patthoyts Exp $ package require tcltest 2.1 eval tcltest::configure $argv @@ -309,8 +309,8 @@ test font-8.4 {font command: families} { test font-9.1 {font command: measure: arguments} { # (skip < 0) - list [catch {font measure xyz -displayof} msg] $msg -} {1 {value for "-displayof" missing}} + list [catch {expr {[font measure xyz -displayof]>0}} msg] $msg +} {0 1} test font-9.2 {font command: measure: arguments} { # (objc - skip != 4) list [catch {font measure} msg] $msg @@ -327,6 +327,15 @@ test font-9.5 {font command: measure} { # Tk_TextWidth() expr [font measure $fixed "abcdefg"]==[font measure $fixed "a"]*7 } {1} +test font-9.6 {font command: measure -d} { + list [catch {expr {[font measure $fixed -d] > 0}} msg] $msg +} {0 1} +test font-9.7 {font command: measure -d with -displayof} { + list [catch {expr {[font measure $fixed -displayof . -d] > 0}} msg] $msg +} {0 1} +test font-9.8 {font command: measure: arguments} { + list [catch {font measure $fixed -displayof .} msg] $msg +} {1 {wrong # args: should be "font measure font ?-displayof window? text"}} test font-10.1 {font command: metrics: arguments} { list [catch {font metrics xyz -displayof} msg] $msg |