summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhershey <hershey>1999-04-06 19:03:29 (GMT)
committerhershey <hershey>1999-04-06 19:03:29 (GMT)
commit73c1bf87490f527fa24b6ce68af7c80a12171ced (patch)
tree4d38f7f4aaf7ecfd5ecdd1f2a0742e384cea41d1
parenta39aefcf8c7e47be6078cac29bdb70630aa5265a (diff)
downloadtk-73c1bf87490f527fa24b6ce68af7c80a12171ced.zip
tk-73c1bf87490f527fa24b6ce68af7c80a12171ced.tar.gz
tk-73c1bf87490f527fa24b6ce68af7c80a12171ced.tar.bz2
skip tests that require test* commands when running in standard wish interp.
-rw-r--r--tests/textIndex.test71
1 files changed, 39 insertions, 32 deletions
diff --git a/tests/textIndex.test b/tests/textIndex.test
index 25357cc..6fb4aed 100644
--- a/tests/textIndex.test
+++ b/tests/textIndex.test
@@ -6,12 +6,17 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
#
-# RCS: @(#) $Id: textIndex.test,v 1.1.4.7 1999/03/29 23:50:34 redman Exp $
+# RCS: @(#) $Id: textIndex.test,v 1.1.4.8 1999/04/06 19:03:29 hershey Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
source [file join [pwd] [file dirname [info script]] defs.tcl]
}
+# Some tests require the testtext command
+
+set ::tcltest::testConfig(testtext) \
+ [expr {[info commands testtext] != {}}]
+
catch {destroy .t}
text .t -font {Courier -12} -width 20 -height 10
pack append . .t {top expand fill}
@@ -38,49 +43,49 @@ Line 7"
image create photo textimage -width 10 -height 10
textimage put red -to 0 0 9 9
-test textIndex-1.1 {TkTextMakeByteIndex} {
+test textIndex-1.1 {TkTextMakeByteIndex} {testtext} {
# (lineIndex < 0)
testtext .t byteindex -1 3
} {1.0 0}
-test textIndex-1.2 {TkTextMakeByteIndex} {
+test textIndex-1.2 {TkTextMakeByteIndex} {testtext} {
# (lineIndex < 0), because lineIndex == strtol(argv[2]) - 1
testtext .t byteindex 0 3
} {1.0 0}
-test textIndex-1.3 {TkTextMakeByteIndex} {
+test textIndex-1.3 {TkTextMakeByteIndex} {testtext} {
# not (lineIndex < 0)
testtext .t byteindex 1 3
} {1.3 3}
-test textIndex-1.4 {TkTextMakeByteIndex} {
+test textIndex-1.4 {TkTextMakeByteIndex} {testtext} {
# (byteIndex < 0)
testtext .t byteindex 3 -1
} {3.0 0}
-test textIndex-1.5 {TkTextMakeByteIndex} {
+test textIndex-1.5 {TkTextMakeByteIndex} {testtext} {
# not (byteIndex < 0)
testtext .t byteindex 3 3
} {3.3 3}
-test textIndex-1.6 {TkTextMakeByteIndex} {
+test textIndex-1.6 {TkTextMakeByteIndex} {testtext} {
# (indexPtr->linePtr == NULL)
testtext .t byteindex 9 2
} {8.0 0}
-test textIndex-1.7 {TkTextMakeByteIndex} {
+test textIndex-1.7 {TkTextMakeByteIndex} {testtext} {
# not (indexPtr->linePtr == NULL)
testtext .t byteindex 7 2
} {7.2 2}
-test textIndex-1.8 {TkTextMakeByteIndex: shortcut for 0} {
+test textIndex-1.8 {TkTextMakeByteIndex: shortcut for 0} {testtext} {
# (byteIndex == 0)
testtext .t byteindex 1 0
} {1.0 0}
-test textIndex-1.9 {TkTextMakeByteIndex: shortcut for 0} {
+test textIndex-1.9 {TkTextMakeByteIndex: shortcut for 0} {testtext} {
# not (byteIndex == 0)
testtext .t byteindex 3 80
} {3.5 5}
-test textIndex-1.10 {TkTextMakeByteIndex: verify index is in range} {
+test textIndex-1.10 {TkTextMakeByteIndex: verify index is in range} {testtext} {
# for (segPtr = indexPtr->linePtr->segPtr; ; segPtr = segPtr->nextPtr)
# one segment
testtext .t byteindex 3 5
} {3.5 5}
-test textIndex-1.11 {TkTextMakeByteIndex: verify index is in range} {
+test textIndex-1.11 {TkTextMakeByteIndex: verify index is in range} {testtext} {
# for (segPtr = indexPtr->linePtr->segPtr; ; segPtr = segPtr->nextPtr)
# index += segPtr->size
# Multiple segments, make sure add segment size to index.
@@ -90,21 +95,21 @@ test textIndex-1.11 {TkTextMakeByteIndex: verify index is in range} {
.t mark unset foo
set x
} {3.5 5}
-test textIndex-1.12 {TkTextMakeByteIndex: verify index is in range} {
+test textIndex-1.12 {TkTextMakeByteIndex: verify index is in range} {testtext} {
# (segPtr == NULL)
testtext .t byteindex 3 7
} {3.5 5}
-test textIndex-1.13 {TkTextMakeByteIndex: verify index is in range} {
+test textIndex-1.13 {TkTextMakeByteIndex: verify index is in range} {testtext} {
# not (segPtr == NULL)
testtext .t byteindex 3 4
} {3.4 4}
-test textIndex-1.14 {TkTextMakeByteIndex: verify index is in range} {
+test textIndex-1.14 {TkTextMakeByteIndex: verify index is in range} {testtext} {
# (index + segPtr->size > byteIndex)
# in this segment.
testtext .t byteindex 3 4
} {3.4 4}
-test textIndex-1.15 {TkTextMakeByteIndex: verify index is in range} {
+test textIndex-1.15 {TkTextMakeByteIndex: verify index is in range} {testtext} {
# (index + segPtr->size > byteIndex), index != 0
# in this segment.
@@ -113,17 +118,19 @@ test textIndex-1.15 {TkTextMakeByteIndex: verify index is in range} {
.t mark unset foo
set x
} {3.4 4}
-test textIndex-1.16 {TkTextMakeByteIndex: UTF-8 characters} {
+test textIndex-1.16 {TkTextMakeByteIndex: UTF-8 characters} {testtext} {
testtext .t byteindex 5 100
} {5.18 20}
-test textIndex-1.17 {TkTextMakeByteIndex: prevent splitting UTF-8 character} {
+test textIndex-1.17 {TkTextMakeByteIndex: prevent splitting UTF-8 character} \
+ {testtext} {
# ((byteIndex > index) && (segPtr->typePtr == &tkTextCharType))
# Wrong answer would be \xb9 (the 2nd byte of UTF rep of 0x4e4f).
set x [testtext .t byteindex 5 2]
list $x [.t get insert]
} {{5.2 4} y}
-test textIndex-1.18 {TkTextMakeByteIndex: prevent splitting UTF-8 character} {
+test textIndex-1.18 {TkTextMakeByteIndex: prevent splitting UTF-8 character} \
+ {testtext} {
# ((byteIndex > index) && (segPtr->typePtr == &tkTextCharType))
testtext .t byteindex 5 1
.t get insert
@@ -364,25 +371,25 @@ test textIndex-10.10 {ForwBack} {
list [catch {.t index {insert +0 chars}} msg] $msg
} {0 2.13}
-test textIndex-11.1 {TkTextIndexForwBytes} {
+test textIndex-11.1 {TkTextIndexForwBytes} {testtext} {
testtext .t forwbytes 2.3 -7
} {1.3 3}
-test textIndex-11.2 {TkTextIndexForwBytes} {
+test textIndex-11.2 {TkTextIndexForwBytes} {testtext} {
testtext .t forwbytes 2.3 5
} {2.8 8}
-test textIndex-11.3 {TkTextIndexForwBytes} {
+test textIndex-11.3 {TkTextIndexForwBytes} {testtext} {
testtext .t forwbytes 2.3 10
} {2.13 13}
-test textIndex-11.4 {TkTextIndexForwBytes} {
+test textIndex-11.4 {TkTextIndexForwBytes} {testtext} {
testtext .t forwbytes 2.3 11
} {3.0 0}
-test textIndex-11.5 {TkTextIndexForwBytes} {
+test textIndex-11.5 {TkTextIndexForwBytes} {testtext} {
testtext .t forwbytes 2.3 57
} {7.6 6}
-test textIndex-11.6 {TkTextIndexForwBytes} {
+test textIndex-11.6 {TkTextIndexForwBytes} {testtext} {
testtext .t forwbytes 2.3 58
} {8.0 0}
-test textIndex-11.7 {TkTextIndexForwBytes} {
+test textIndex-11.7 {TkTextIndexForwBytes} {testtext} {
testtext .t forwbytes 2.3 59
} {8.0 0}
@@ -465,22 +472,22 @@ test textIndex-12.14 {TkTextIndexForwChars} {
.t index {2.3 + 57 chars}
} 8.0
-test textIndex-13.1 {TkTextIndexBackBytes} {
+test textIndex-13.1 {TkTextIndexBackBytes} {testtext} {
testtext .t backbytes 3.2 -10
} {4.6 6}
-test textIndex-12.2 {TkTextIndexBackBytes} {
+test textIndex-13.2 {TkTextIndexBackBytes} {testtext} {
testtext .t backbytes 3.2 2
} {3.0 0}
-test textIndex-12.3 {TkTextIndexBackBytes} {
+test textIndex-13.3 {TkTextIndexBackBytes} {testtext} {
testtext .t backbytes 3.2 3
} {2.13 13}
-test textIndex-12.4 {TkTextIndexBackBytes} {
+test textIndex-13.4 {TkTextIndexBackBytes} {testtext} {
testtext .t backbytes 3.2 22
} {1.1 1}
-test textIndex-12.5 {TkTextIndexBackBytes} {
+test textIndex-13.5 {TkTextIndexBackBytes} {testtext} {
testtext .t backbytes 3.2 23
} {1.0 0}
-test textIndex-12.6 {TkTextIndexBackBytes} {
+test textIndex-13.6 {TkTextIndexBackBytes} {testtext} {
testtext .t backbytes 3.2 24
} {1.0 0}