summaryrefslogtreecommitdiffstats
path: root/tests/textTag.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/textTag.test')
-rw-r--r--tests/textTag.test35
1 files changed, 19 insertions, 16 deletions
diff --git a/tests/textTag.test b/tests/textTag.test
index 04a4b30..1edfcb2 100644
--- a/tests/textTag.test
+++ b/tests/textTag.test
@@ -1,9 +1,9 @@
# This file is a Tcl script to test the code in the file tkTextTag.c.
# This file is organized in the standard fashion for Tcl tests.
#
-# Copyright (c) 1994 The Regents of the University of California.
-# Copyright (c) 1994-1996 Sun Microsystems, Inc.
-# Copyright (c) 1998-1999 by Scriptics Corporation.
+# Copyright © 1994 The Regents of the University of California.
+# Copyright © 1994-1996 Sun Microsystems, Inc.
+# Copyright © 1998-1999 by Scriptics Corporation.
# All rights reserved.
package require tcltest 2.2
@@ -26,6 +26,9 @@ testConstraint haveFontSizes [expr {
[font actual $bigFont -size] == 24 }
]
+testConstraint failsOnUbuntu [expr {![info exists ::env(TRAVIS_OS_NAME)] || ![string match linux $::env(TRAVIS_OS_NAME)]}]
+testConstraint failsOnUbuntuNoXft [expr {[testConstraint failsOnUbuntu] || (![catch {tk::pkgconfig get fontsystem} fs] && ($fs eq "xft"))}]
+
destroy .t
text .t -width 20 -height 10
@@ -78,7 +81,7 @@ test textTag-1.5 {tag configuration options} -body {
.t tag cget x -borderwidth
} -cleanup {
.t tag configure x -borderwidth [lindex [.t tag configure x -borderwidth] 3]
-} -result {2}
+} -result 2
test textTag-1.6 {configuration options} -body {
.t tag configure x -borderwidth 46q
} -cleanup {
@@ -128,7 +131,7 @@ test textTag-1.14 {tag configuration options} -body {
.t tag cget x -lmargin1
} -cleanup {
.t tag configure x -lmargin1 [lindex [.t tag configure x -lmargin1] 3]
-} -result {10}
+} -result 10
test textTag-1.15 {configuration options} -body {
.t tag configure x -lmargin1 bad
} -cleanup {
@@ -139,7 +142,7 @@ test textTag-1.16 {tag configuration options} -body {
.t tag cget x -lmargin2
} -cleanup {
.t tag configure x -lmargin2 [lindex [.t tag configure x -lmargin2] 3]
-} -result {10}
+} -result 10
test textTag-1.17 {configuration options} -body {
.t tag configure x -lmargin2 bad
} -cleanup {
@@ -161,7 +164,7 @@ test textTag-1.18 {tag configuration options} -body {
.t tag cget x -offset
} -cleanup {
.t tag configure x -offset [lindex [.t tag configure x -offset] 3]
-} -result {2}
+} -result 2
test textTag-1.19 {configuration options} -body {
.t tag configure x -offset 100xyz
} -cleanup {
@@ -205,7 +208,7 @@ test textTag-1.24 {tag configuration options} -body {
.t tag cget x -rmargin
} -cleanup {
.t tag configure x -rmargin [lindex [.t tag configure x -rmargin] 3]
-} -result {10}
+} -result 10
test textTag-1.25 {configuration options} -body {
.t tag configure x -rmargin bad
} -cleanup {
@@ -249,7 +252,7 @@ test textTag-1.26 {tag configuration options} -body {
.t tag cget x -spacing1
} -cleanup {
.t tag configure x -spacing1 [lindex [.t tag configure x -spacing1] 3]
-} -result {10}
+} -result 10
test textTag-1.27 {configuration options} -body {
.t tag configure x -spacing1 bad
} -cleanup {
@@ -260,7 +263,7 @@ test textTag-1.28 {tag configuration options} -body {
.t tag cget x -spacing2
} -cleanup {
.t tag configure x -spacing2 [lindex [.t tag configure x -spacing2] 3]
-} -result {10}
+} -result 10
test textTag-1.29 {configuration options} -body {
.t tag configure x -spacing2 bad
} -cleanup {
@@ -271,7 +274,7 @@ test textTag-1.30 {tag configuration options} -body {
.t tag cget x -spacing3
} -cleanup {
.t tag configure x -spacing3 [lindex [.t tag configure x -spacing3] 3]
-} -result {10}
+} -result 10
test textTag-1.31 {configuration options} -body {
.t tag configure x -spacing3 bad
} -cleanup {
@@ -399,7 +402,7 @@ test textTag-2.14 {tag add before -startline - Bug 1615425} -body {
.tt tag add mytag 1.0 1.end
destroy .ptt .tt
set res 1
-} -result {1}
+} -result 1
test textTag-3.1 {TkTextTagCmd - "bind" option} -body {
@@ -488,7 +491,7 @@ test textTag-4.5 {TkTextTagCmd - "cget" option} -body {
test textTag-5.1 {TkTextTagCmd - "configure" option} -body {
.t tag configure
-} -returnCodes error -result {wrong # args: should be ".t tag configure tagName ?-option? ?value? ?-option value ...?"}
+} -returnCodes error -result {wrong # args: should be ".t tag configure tagName ?-option value ...?"}
test textTag-5.2 {TkTextTagCmd - "configure" option} -body {
.t tag configure x -foo
} -returnCodes error -result {unknown option "-foo"}
@@ -1342,7 +1345,7 @@ test textTag-16.1 {TkTextPickCurrent procedure} -setup {
} -result {2.1 3.2 3.2 3.2 3.2 3.2 4.3}
test textTag-16.2 {TkTextPickCurrent procedure} -constraints {
- haveFontSizes
+ haveFontSizes failsOnUbuntuNoXft
} -setup {
.t tag delete {*}[.t tag names]
wm geometry . +200+200 ; update
@@ -1438,7 +1441,7 @@ test textTag-16.5 {TkTextPickCurrent procedure} -constraints {
} -result {3.2}
test textTag-16.6 {TkTextPickCurrent procedure} -constraints {
- haveFontSizes
+ haveFontSizes failsOnUbuntuNoXft
} -setup {
foreach i {big a b c d} {
.t tag remove $i 1.0 end
@@ -1460,7 +1463,7 @@ test textTag-16.6 {TkTextPickCurrent procedure} -constraints {
} -result {3.1}
test textTag-16.7 {TkTextPickCurrent procedure} -constraints {
- haveFontSizes
+ haveFontSizes failsOnUbuntuNoXft
} -setup {
foreach i {big a b c d} {
.t tag remove $i 1.0 end