summaryrefslogtreecommitdiffstats
path: root/tests/textIndex.test
diff options
context:
space:
mode:
authorvincentdarley <vincentdarley@noemail.net>2003-05-19 13:04:21 (GMT)
committervincentdarley <vincentdarley@noemail.net>2003-05-19 13:04:21 (GMT)
commita3e21ab249ac0d6ea4a457c19ec358e5fdf441b3 (patch)
treeff3118e296016bb30e790c80a6e787ef78969042 /tests/textIndex.test
parent7d698894fcf873c59854721894c1346b7329372c (diff)
downloadtk-a3e21ab249ac0d6ea4a457c19ec358e5fdf441b3.zip
tk-a3e21ab249ac0d6ea4a457c19ec358e5fdf441b3.tar.gz
tk-a3e21ab249ac0d6ea4a457c19ec358e5fdf441b3.tar.bz2
tip 113 implementation
FossilOrigin-Name: 7ef32f7c99a098ed9e22bc612e400c8ef9c2196b
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}