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)
commitcf597519de1f5e18be3c07e6988cb6e91300ed6e (patch)
treeff3118e296016bb30e790c80a6e787ef78969042 /tests/textIndex.test
parent20218318b32692b54a27224fbd7676d7483732e0 (diff)
downloadtk-cf597519de1f5e18be3c07e6988cb6e91300ed6e.zip
tk-cf597519de1f5e18be3c07e6988cb6e91300ed6e.tar.gz
tk-cf597519de1f5e18be3c07e6988cb6e91300ed6e.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}