summaryrefslogtreecommitdiffstats
path: root/tests/textIndex.test
diff options
context:
space:
mode:
authorvincentdarley <vincentdarley>2003-05-19 13:04:21 (GMT)
committervincentdarley <vincentdarley>2003-05-19 13:04:21 (GMT)
commit558e68b50f8336bba678288ea4ff835ec5fe2dfe (patch)
treeff3118e296016bb30e790c80a6e787ef78969042 /tests/textIndex.test
parent616f05be70114b4ddcbc9153909a57bb8104384d (diff)
downloadtk-558e68b50f8336bba678288ea4ff835ec5fe2dfe.zip
tk-558e68b50f8336bba678288ea4ff835ec5fe2dfe.tar.gz
tk-558e68b50f8336bba678288ea4ff835ec5fe2dfe.tar.bz2
tip 113 implementation
Diffstat (limited to 'tests/textIndex.test')
-rw-r--r--tests/textIndex.test35
1 files changed, 33 insertions, 2 deletions
diff --git a/tests/textIndex.test b/tests/textIndex.test
index a80af7c..0f9a468 100644
--- a/tests/textIndex.test
+++ b/tests/textIndex.test
@@ -6,7 +6,7 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
#
-# RCS: @(#) $Id: textIndex.test,v 1.8 2003/04/01 21:06:54 dgp Exp $
+# RCS: @(#) $Id: textIndex.test,v 1.9 2003/05/19 13:04:24 vincentdarley Exp $
package require tcltest 2.1
eval tcltest::configure $argv
@@ -654,7 +654,6 @@ test testIndex-16.1 {TkTextPrintIndex} {
catch {destroy $t}
} 0
-
test testIndex-16.2 {TkTextPrintIndex} {
set t [text .t2]
$t insert end \n
@@ -664,6 +663,38 @@ test testIndex-16.2 {TkTextPrintIndex} {
catch {destroy $t}
} 0
+test testIndex-17.1 {Object indices} {
+ set res {}
+ set t [text .t2 -height 20]
+ for {set i 0} {$i < 100} {incr i} {
+ $t insert end $i\n
+ }
+ pack $t
+ update
+ set idx @0,0
+ lappend res $idx [$t index $idx]
+ $t yview scroll 2 pages
+ lappend res $idx [$t index $idx]
+ catch {destroy $t}
+ unset i
+ unset idx
+ list $res
+} {{@0,0 1.0 @0,0 37.0}}
+
+test testIndex-18.1 {Object indices don't cache mark names} {
+ set res {}
+ text .t2
+ .t2 insert 1.0 1234\n1234\n1234
+ set pos "insert"
+ lappend res [.t2 index $pos]
+ .t2 mark set $pos 3.0
+ lappend res [.t2 index $pos]
+ .t2 mark set $pos 1.0
+ lappend res [.t2 index $pos]
+ catch {destroy .t2}
+ set res
+} {3.4 3.0 1.0}
+
# cleanup
rename textimage {}
catch {destroy .t}