summaryrefslogtreecommitdiffstats
path: root/tests/stringObj.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/stringObj.test')
-rw-r--r--tests/stringObj.test268
1 files changed, 110 insertions, 158 deletions
diff --git a/tests/stringObj.test b/tests/stringObj.test
index 6fbdc05..3b25592 100644
--- a/tests/stringObj.test
+++ b/tests/stringObj.test
@@ -1,35 +1,30 @@
# Commands covered: none
#
-# This file contains tests for the procedures in tclStringObj.c that implement
-# the Tcl type manager for the string type.
+# This file contains tests for the procedures in tclStringObj.c
+# that implement the Tcl type manager for the string type.
#
-# Sourcing this file into Tcl runs the tests and generates output for errors.
-# No output means no errors were found.
+# Sourcing this file into Tcl runs the tests and generates output for
+# errors. No output means no errors were found.
#
-# Copyright © 1995-1997 Sun Microsystems, Inc.
-# Copyright © 1998-1999 Scriptics Corporation.
+# Copyright (c) 1995-1997 Sun Microsystems, Inc.
+# Copyright (c) 1998-1999 by Scriptics Corporation.
#
-# See the file "license.terms" for information on usage and redistribution of
-# this file, and for a DISCLAIMER OF ALL WARRANTIES.
+# See the file "license.terms" for information on usage and redistribution
+# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
-if {"::tcltest" ni [namespace children]} {
- package require tcltest 2.5
+if {[lsearch [namespace children] ::tcltest] == -1} {
+ package require tcltest
namespace import -force ::tcltest::*
}
-::tcltest::loadTestedCommands
-catch [list package require -exact tcl::test [info patchlevel]]
-source [file join [file dirname [info script]] tcltests.tcl]
-
testConstraint testobj [llength [info commands testobj]]
-testConstraint testbytestring [llength [info commands testbytestring]]
testConstraint testdstring [llength [info commands testdstring]]
-
-test stringObj-1.1 {string type registration} {testobj deprecated} {
+
+test stringObj-1.1 {string type registration} testobj {
set t [testobj types]
set first [string first "string" $t]
- set result [expr {$first >= 0}]
-} 1
+ set result [expr {$first != -1}]
+} {1}
test stringObj-2.1 {Tcl_NewStringObj} testobj {
set result ""
@@ -43,7 +38,7 @@ test stringObj-3.1 {Tcl_SetStringObj, existing "empty string" object} testobj {
set result ""
lappend result [testobj freeallvars]
lappend result [testobj newobj 1]
- lappend result [teststringobj set 1 xyz] ;# makes existing obj a string
+ lappend result [teststringobj set 1 xyz] ;# makes existing obj a string
lappend result [testobj type 1]
lappend result [testobj refcount 1]
} {{} {} xyz string 2}
@@ -51,32 +46,32 @@ test stringObj-3.2 {Tcl_SetStringObj, existing non-"empty string" object} testob
set result ""
lappend result [testobj freeallvars]
lappend result [testintobj set 1 512]
- lappend result [teststringobj set 1 foo] ;# makes existing obj a string
+ lappend result [teststringobj set 1 foo] ;# makes existing obj a string
lappend result [testobj type 1]
lappend result [testobj refcount 1]
} {{} 512 foo string 2}
-test stringObj-4.1 {Tcl_SetObjLength procedure, string gets shorter} {testobj deprecated} {
+test stringObj-4.1 {Tcl_SetObjLength procedure, string gets shorter} testobj {
testobj freeallvars
teststringobj set 1 test
teststringobj setlength 1 3
list [teststringobj length 1] [teststringobj length2 1] \
[teststringobj get 1]
-} {3 3 tes}
+} {3 4 tes}
test stringObj-4.2 {Tcl_SetObjLength procedure, string gets longer} testobj {
testobj freeallvars
teststringobj set 1 abcdef
teststringobj setlength 1 10
- teststringobj length 1
-} 10
-test stringObj-4.3 {Tcl_SetObjLength procedure, string gets longer} {testobj deprecated} {
+ list [teststringobj length 1] [teststringobj length2 1]
+} {10 10}
+test stringObj-4.3 {Tcl_SetObjLength procedure, string gets longer} testobj {
testobj freeallvars
teststringobj set 1 abcdef
teststringobj append 1 xyzq -1
list [teststringobj length 1] [teststringobj length2 1] \
[teststringobj get 1]
-} {10 10 abcdefxyzq}
-test stringObj-4.4 {Tcl_SetObjLength procedure, "empty string", length 0} {testobj deprecated} {
+} {10 20 abcdefxyzq}
+test stringObj-4.4 {Tcl_SetObjLength procedure, "expty string", length 0} testobj {
testobj freeallvars
testobj newobj 1
teststringobj setlength 1 0
@@ -96,7 +91,7 @@ test stringObj-5.2 {Tcl_AppendToObj procedure, length calculation} testobj {
teststringobj append 1 123 -1
teststringobj get 1
} {x y bbCC123}
-test stringObj-5.3 {Tcl_AppendToObj procedure, reallocating space} {testobj deprecated} {
+test stringObj-5.3 {Tcl_AppendToObj procedure, reallocating space} testobj {
testobj freeallvars
teststringobj set 1 xyz
teststringobj setlength 1 15
@@ -108,7 +103,7 @@ test stringObj-5.3 {Tcl_AppendToObj procedure, reallocating space} {testobj depr
teststringobj append 1 abcdef -1
lappend result [teststringobj length 1] [teststringobj length2 1] \
[teststringobj get 1]
-} {15 15 16 16 xy12345678abcdef}
+} {15 15 16 32 xy12345678abcdef}
test stringObj-6.1 {Tcl_AppendStringsToObj procedure, type conversion} testobj {
testobj freeallvars
@@ -134,13 +129,13 @@ test stringObj-6.4 {Tcl_AppendStringsToObj procedure, counting space} testobj {
teststringobj appendstrings 1 { 123 } abcdefg
list [teststringobj length 1] [teststringobj get 1]
} {15 {abc 123 abcdefg}}
-test stringObj-6.5 {Tcl_AppendStringsToObj procedure, don't double space if initial string empty} {testobj deprecated} {
+test stringObj-6.5 {Tcl_AppendStringsToObj procedure, don't double space if initial string empty} testobj {
testobj freeallvars
testobj newobj 1
teststringobj appendstrings 1 123 abcdefg
list [teststringobj length 1] [teststringobj length2 1] [teststringobj get 1]
} {10 10 123abcdefg}
-test stringObj-6.6 {Tcl_AppendStringsToObj procedure, space reallocation} {testobj deprecated} {
+test stringObj-6.6 {Tcl_AppendStringsToObj procedure, space reallocation} testobj {
testobj freeallvars
teststringobj set 1 abc
teststringobj setlength 1 10
@@ -149,7 +144,7 @@ test stringObj-6.6 {Tcl_AppendStringsToObj procedure, space reallocation} {testo
list [teststringobj length 1] [teststringobj length2 1] \
[teststringobj get 1]
} {10 10 ab34567890}
-test stringObj-6.7 {Tcl_AppendStringsToObj procedure, space reallocation} {testobj deprecated} {
+test stringObj-6.7 {Tcl_AppendStringsToObj procedure, space reallocation} testobj {
testobj freeallvars
teststringobj set 1 abc
teststringobj setlength 1 10
@@ -157,8 +152,8 @@ test stringObj-6.7 {Tcl_AppendStringsToObj procedure, space reallocation} {testo
teststringobj appendstrings 1 34567890x
list [teststringobj length 1] [teststringobj length2 1] \
[teststringobj get 1]
-} {11 11 ab34567890x}
-test stringObj-6.8 {Tcl_AppendStringsToObj procedure, object totally empty} {testobj deprecated} {
+} {11 22 ab34567890x}
+test stringObj-6.8 {Tcl_AppendStringsToObj procedure, object totally empty} testobj {
testobj freeallvars
testobj newobj 1
teststringobj appendstrings 1 {}
@@ -171,14 +166,14 @@ test stringObj-6.9 {Tcl_AppendStringToObj, pure unicode} testobj {
teststringobj get 1
} adcfoobarsoom
-test stringObj-7.1 {SetStringFromAny procedure} {testobj deprecated} {
+test stringObj-7.1 {SetStringFromAny procedure} testobj {
testobj freeallvars
teststringobj set2 1 [list a b]
teststringobj append 1 x -1
list [teststringobj length 1] [teststringobj length2 1] \
[teststringobj get 1]
-} {4 4 {a bx}}
-test stringObj-7.2 {SetStringFromAny procedure, null object} {testobj deprecated} {
+} {4 8 {a bx}}
+test stringObj-7.2 {SetStringFromAny procedure, null object} testobj {
testobj freeallvars
testobj newobj 1
teststringobj appendstrings 1 {}
@@ -196,30 +191,30 @@ test stringObj-7.4 {SetStringFromAny called with string obj} testobj {
[string length $x] [testobj objtype $x]
} {6 string 6 string}
-test stringObj-8.1 {DupStringInternalRep procedure} {testobj deprecated} {
+test stringObj-8.1 {DupStringInternalRep procedure} testobj {
testobj freeallvars
teststringobj set 1 {}
teststringobj append 1 abcde -1
testobj duplicate 1 2
list [teststringobj length 1] [teststringobj length2 1] \
- [teststringobj maxchars 1] [teststringobj get 1] \
+ [teststringobj ualloc 1] [teststringobj get 1] \
[teststringobj length 2] [teststringobj length2 2] \
- [teststringobj maxchars 2] [teststringobj get 2]
-} {5 5 5 abcde 5 5 5 abcde}
+ [teststringobj ualloc 2] [teststringobj get 2]
+} {5 10 0 abcde 5 5 0 abcde}
test stringObj-8.2 {DupUnicodeInternalRep, mixed width chars} testobj {
- set x abc\xEF\xBF\xAEghi
+ set x abcï¿®ghi
string length $x
set y $x
- list [testobj objtype $x] [testobj objtype $y] [append x "\xAE\xBF\xEF"] \
+ list [testobj objtype $x] [testobj objtype $y] [append x "®¿ï"] \
[set y] [testobj objtype $x] [testobj objtype $y]
-} "string string abc\xEF\xBF\xAEghi\xAE\xBF\xEF abc\xEF\xBF\xAEghi string string"
+} {string string abcï¿®ghi®¿ï abcï¿®ghi string string}
test stringObj-8.3 {DupUnicodeInternalRep, mixed width chars} testobj {
- set x abc\xEF\xBF\xAEghi
+ set x abcï¿®ghi
set y $x
string length $x
- list [testobj objtype $x] [testobj objtype $y] [append x "\xAE\xBF\xEF"] \
+ list [testobj objtype $x] [testobj objtype $y] [append x "®¿ï"] \
[set y] [testobj objtype $x] [testobj objtype $y]
-} "string string abc\xEF\xBF\xAEghi\xAE\xBF\xEF abc\xEF\xBF\xAEghi string string"
+} {string string abcï¿®ghi®¿ï abcï¿®ghi string string}
test stringObj-8.4 {DupUnicodeInternalRep, all byte-size chars} testobj {
set x abcdefghi
string length $x
@@ -236,31 +231,31 @@ test stringObj-8.5 {DupUnicodeInternalRep, all byte-size chars} testobj {
} {string string abcdefghijkl abcdefghi string string}
test stringObj-9.1 {TclAppendObjToObj, mixed src & dest} {testobj testdstring} {
- set x abc\xEF\xBF\xAEghi
+ set x abc\u00ef\u00bf\u00aeghi
testdstring free
- testdstring append \xAE\xBF\xEF -1
+ testdstring append \u00ae\u00bf\u00ef -1
set y [testdstring get]
string length $x
list [testobj objtype $x] [testobj objtype $y] [append x $y] \
- [set y] [testobj objtype $x] [testobj objtype $y]
-} "string none abc\xEF\xBF\xAEghi\xAE\xBF\xEF \xAE\xBF\xEF string none"
+ [set y] [testobj objtype $x] [testobj objtype $y]
+} "string none abc\u00ef\u00bf\u00aeghi\u00ae\u00bf\u00ef \u00ae\u00bf\u00ef string none"
test stringObj-9.2 {TclAppendObjToObj, mixed src & dest} testobj {
- set x abc\xEF\xBF\xAEghi
+ set x abcï¿®ghi
string length $x
list [testobj objtype $x] [append x $x] [testobj objtype $x] \
[append x $x] [testobj objtype $x]
-} "string abc\xEF\xBF\xAEghiabc\xEF\xBF\xAEghi string\
-abc\xEF\xBF\xAEghiabc\xEF\xBF\xAEghiabc\xEF\xBF\xAEghiabc\xEF\xBF\xAEghi\
-string"
+} {string abcï¿®ghiabcï¿®ghi string\
+abcï¿®ghiabcï¿®ghiabcï¿®ghiabcï¿®ghi\
+string}
test stringObj-9.3 {TclAppendObjToObj, mixed src & 1-byte dest} {testobj testdstring} {
set x abcdefghi
testdstring free
- testdstring append \xAE\xBF\xEF -1
+ testdstring append \u00ae\u00bf\u00ef -1
set y [testdstring get]
string length $x
list [testobj objtype $x] [testobj objtype $y] [append x $y] \
- [set y] [testobj objtype $x] [testobj objtype $y]
-} "string none abcdefghi\xAE\xBF\xEF \xAE\xBF\xEF string none"
+ [set y] [testobj objtype $x] [testobj objtype $y]
+} "string none abcdefghi\u00ae\u00bf\u00ef \u00ae\u00bf\u00ef string none"
test stringObj-9.4 {TclAppendObjToObj, 1-byte src & dest} {testobj testdstring} {
set x abcdefghi
testdstring free
@@ -268,7 +263,7 @@ test stringObj-9.4 {TclAppendObjToObj, 1-byte src & dest} {testobj testdstring}
set y [testdstring get]
string length $x
list [testobj objtype $x] [testobj objtype $y] [append x $y] \
- [set y] [testobj objtype $x] [testobj objtype $y]
+ [set y] [testobj objtype $x] [testobj objtype $y]
} {string none abcdefghijkl jkl string none}
test stringObj-9.5 {TclAppendObjToObj, 1-byte src & dest} testobj {
set x abcdefghi
@@ -278,14 +273,14 @@ test stringObj-9.5 {TclAppendObjToObj, 1-byte src & dest} testobj {
} {string abcdefghiabcdefghi string abcdefghiabcdefghiabcdefghiabcdefghi\
string}
test stringObj-9.6 {TclAppendObjToObj, 1-byte src & mixed dest} {testobj testdstring} {
- set x abc\xEF\xBF\xAEghi
+ set x abc\u00ef\u00bf\u00aeghi
testdstring free
testdstring append jkl -1
set y [testdstring get]
string length $x
list [testobj objtype $x] [testobj objtype $y] [append x $y] \
- [set y] [testobj objtype $x] [testobj objtype $y]
-} "string none abc\xEF\xBF\xAEghijkl jkl string none"
+ [set y] [testobj objtype $x] [testobj objtype $y]
+} "string none abc\u00ef\u00bf\u00aeghijkl jkl string none"
test stringObj-9.7 {TclAppendObjToObj, integer src & dest} testobj {
set x [expr {4 * 5}]
set y [expr {4 + 5}]
@@ -306,19 +301,20 @@ test stringObj-9.9 {TclAppendObjToObj, integer src & 1-byte dest} testobj {
[set y] [testobj objtype $x] [testobj objtype $y]
} {string int abcdefghi9 9 string int}
test stringObj-9.10 {TclAppendObjToObj, integer src & mixed dest} testobj {
- set x abc\xEF\xBF\xAEghi
+ set x abcï¿®ghi
set y [expr {4 + 5}]
string length $x
list [testobj objtype $x] [testobj objtype $y] [append x $y] \
[set y] [testobj objtype $x] [testobj objtype $y]
-} "string int abc\xEF\xBF\xAEghi9 9 string int"
+} {string int abcï¿®ghi9 9 string int}
test stringObj-9.11 {TclAppendObjToObj, mixed src & 1-byte dest index check} testobj {
# bug 2678, in <=8.2.0, the second obj (the one to append) in
- # Tcl_AppendObjToObj was not correctly checked to see if it was all one
- # byte chars, so a Unicode string would be added as one byte chars.
+ # Tcl_AppendObjToObj was not correctly checked to see if it was
+ # all one byte chars, so a unicode string would be added as one
+ # byte chars.
set x abcdef
set len [string length $x]
- set y a\xFCb\xE5c\xEF
+ set y aübåcï
set len [string length $y]
append x $y
string length $x
@@ -327,40 +323,51 @@ test stringObj-9.11 {TclAppendObjToObj, mixed src & 1-byte dest index check} tes
lappend q [string index $x $i]
}
set q
-} "a b c d e f a \xFC b \xE5 c \xEF"
+} {a b c d e f a ü b å c ï}
test stringObj-10.1 {Tcl_GetRange with all byte-size chars} {testobj testdstring} {
testdstring free
testdstring append abcdef -1
set x [testdstring get]
list [testobj objtype $x] [set y [string range $x 1 end-1]] \
- [testobj objtype $x] [testobj objtype $y]
+ [testobj objtype $x] [testobj objtype $y]
} [list none bcde string string]
test stringObj-10.2 {Tcl_GetRange with some mixed width chars} {testobj testdstring} {
+ # Because this test does not use \uXXXX notation below instead of
+ # hardcoding the values, it may fail in multibyte locales. However, we
+ # need to test that the parser produces untyped objects even when there
+ # are high-ASCII characters in the input (like "ï"). I don't know what
+ # else to do but inline those characters here.
testdstring free
- testdstring append "abcïïdef" -1
+ testdstring append "abc\u00ef\u00efdef" -1
set x [testdstring get]
list [testobj objtype $x] [set y [string range $x 1 end-1]] \
- [testobj objtype $x] [testobj objtype $y]
-} [list none "bcïïde" string string]
+ [testobj objtype $x] [testobj objtype $y]
+} [list none "bc\u00EF\u00EFde" string string]
test stringObj-10.3 {Tcl_GetRange with some mixed width chars} testobj {
- set x "abcïïdef"
+ # set x "abcïïdef"
+ # Use \uXXXX notation below instead of hardcoding the values, otherwise
+ # the test will fail in multibyte locales.
+ set x "abc\u00EF\u00EFdef"
string length $x
list [testobj objtype $x] [set y [string range $x 1 end-1]] \
[testobj objtype $x] [testobj objtype $y]
-} [list string "bcïïde" string string]
+} [list string "bc\u00EF\u00EFde" string string]
test stringObj-10.4 {Tcl_GetRange with some mixed width chars} testobj {
- set a "ïa¿b®cï¿d®"
+ # set a "ïa¿b®cï¿d®"
+ # Use \uXXXX notation below instead of hardcoding the values, otherwise
+ # the test will fail in multibyte locales.
+ set a "\u00EFa\u00BFb\u00AEc\u00EF\u00BFd\u00AE"
set result [list]
while {[string length $a] > 0} {
set a [string range $a 1 end-1]
lappend result $a
}
set result
-} [list a\xBFb\xAEc\xEF\xBFd \
- \xBFb\xAEc\xEF\xBF \
- b\xAEc\xEF \
- \xAEc \
+} [list a\u00BFb\u00AEc\u00EF\u00BFd \
+ \u00BFb\u00AEc\u00EF\u00BF \
+ b\u00AEc\u00EF \
+ \u00AEc \
{}]
test stringObj-11.1 {UpdateStringOfString} testobj {
@@ -382,15 +389,15 @@ test stringObj-12.3 {Tcl_GetUniChar with byte-size chars} testobj {
list [string index $x end] [string index $x end-1]
} {i h}
test stringObj-12.4 {Tcl_GetUniChar with mixed width chars} testobj {
- string index "\xEFa\xBFb\xAEc\xAE\xBFd\xEF" 0
-} "\xEF"
+ string index "ïa¿b®c®¿dï" 0
+} "ï"
test stringObj-12.5 {Tcl_GetUniChar} testobj {
- set x "\xEFa\xBFb\xAEc\xAE\xBFd\xEF"
+ set x "ïa¿b®c®¿dï"
list [string index $x 4] [string index $x 0]
-} "\xAE \xEF"
+} {® ï}
test stringObj-12.6 {Tcl_GetUniChar} testobj {
- string index "\xEFa\xBFb\xAEc\xEF\xBFd\xAE" end
-} "\xAE"
+ string index "ïa¿b®cï¿d®" end
+} "®"
test stringObj-13.1 {Tcl_GetCharLength with byte-size chars} testobj {
set a ""
@@ -404,34 +411,34 @@ test stringObj-13.3 {Tcl_GetCharLength with byte-size chars} testobj {
list [string length $a] [string length $a]
} {6 6}
test stringObj-13.4 {Tcl_GetCharLength with mixed width chars} testobj {
- string length "\xAE"
+ string length "®"
} 1
test stringObj-13.5 {Tcl_GetCharLength with mixed width chars} testobj {
- # string length "○○"
- # Use \uXXXX notation below instead of hard-coding the values, otherwise
+ # string length "○○"
+ # Use \uXXXX notation below instead of hardcoding the values, otherwise
# the test will fail in multibyte locales.
- string length "\xEF\xBF\xAE\xEF\xBF\xAE"
+ string length "\u00EF\u00BF\u00AE\u00EF\u00BF\u00AE"
} 6
test stringObj-13.6 {Tcl_GetCharLength with mixed width chars} testobj {
- # set a "ïa¿b®cï¿d®"
- # Use \uXXXX notation below instead of hard-coding the values, otherwise
+ # set a "ïa¿b®cï¿d®"
+ # Use \uXXXX notation below instead of hardcoding the values, otherwise
# the test will fail in multibyte locales.
- set a "\xEFa\xBFb\xAEc\xEF\xBFd\xAE"
+ set a "\u00EFa\u00BFb\u00AEc\u00EF\u00BFd\u00AE"
list [string length $a] [string length $a]
} {10 10}
-test stringObj-13.7 {Tcl_GetCharLength with identity nulls} {testobj testbytestring} {
+test stringObj-13.7 {Tcl_GetCharLength with identity nulls} testobj {
# SF bug #684699
- string length [testbytestring \x00]
+ string length [encoding convertfrom identity \x00]
} 1
-test stringObj-13.8 {Tcl_GetCharLength with identity nulls} {testobj testbytestring} {
- string length [testbytestring \x01\x00\x02]
+test stringObj-13.8 {Tcl_GetCharLength with identity nulls} testobj {
+ string length [encoding convertfrom identity \x01\x00\x02]
} 3
test stringObj-14.1 {Tcl_SetObjLength on pure unicode object} testobj {
teststringobj set 1 foo
- teststringobj maxchars 1
+ teststringobj getunicode 1
teststringobj append 1 bar -1
- teststringobj maxchars 1
+ teststringobj getunicode 1
teststringobj append 1 bar -1
teststringobj setlength 1 0
teststringobj append 1 bar -1
@@ -454,74 +461,23 @@ test stringObj-15.4 {Tcl_Append*ToObj: self appends} testobj {
teststringobj set 1 foo
teststringobj appendself 1 3
} foo
-test stringObj-15.5 {Tcl_Append*ToObj: self appends} {testobj knownBug deprecated} {
+test stringObj-15.5 {Tcl_Append*ToObj: self appends} testobj {
teststringobj set 1 foo
teststringobj appendself2 1 0
} foofoo
-test stringObj-15.6 {Tcl_Append*ToObj: self appends} {testobj knownBug deprecated} {
+test stringObj-15.6 {Tcl_Append*ToObj: self appends} testobj {
teststringobj set 1 foo
teststringobj appendself2 1 1
} foooo
-test stringObj-15.7 {Tcl_Append*ToObj: self appends} {testobj knownBug deprecated} {
+test stringObj-15.7 {Tcl_Append*ToObj: self appends} testobj {
teststringobj set 1 foo
teststringobj appendself2 1 2
} fooo
-test stringObj-15.8 {Tcl_Append*ToObj: self appends} {testobj deprecated} {
+test stringObj-15.8 {Tcl_Append*ToObj: self appends} testobj {
teststringobj set 1 foo
teststringobj appendself2 1 3
} foo
-test stringObj-16.0 {Tcl_GetRange: normal case} {testobj deprecated} {
- teststringobj set 1 abcde
- teststringobj range 1 1 3
-} bcd
-test stringObj-16.1 {Tcl_GetRange: first > end} {testobj deprecated} {
- teststringobj set 1 abcde
- teststringobj range 1 10 5
-} {}
-test stringObj-16.2 {Tcl_GetRange: last > end} {testobj deprecated} {
- teststringobj set 1 abcde
- teststringobj range 1 3 13
-} de
-test stringObj-16.3 {Tcl_GetRange: first = TCL_INDEX_NONE} {testobj deprecated} {
- teststringobj set 1 abcde
- teststringobj range 1 -1 3
-} abcd
-test stringObj-16.4 {Tcl_GetRange: last = TCL_INDEX_NONE} {testobj deprecated} {
- teststringobj set 1 abcde
- teststringobj range 1 1 -1
-} bcde
-test stringObj-16.5 {Tcl_GetRange: first = last = TCL_INDEX_NONE} {testobj deprecated} {
- teststringobj set 1 abcde
- teststringobj range 1 -1 -1
-} abcde
-test stringObj-16.6 {Tcl_GetRange: old anomaly} {testobj deprecated} {
- # Older implementations could return "cde"
- teststringobj set 1 abcde
- teststringobj range 1 2 0
-} {}
-test stringObj-16.7 {Tcl_GetRange: first = 0x7FFFFFFF-1} {testobj deprecated} {
- teststringobj set 1 abcde
- teststringobj range 1 [expr {0x7FFFFFFF-1}] 3
-} {}
-test stringObj-16.8 {Tcl_GetRange: last = 0x7FFFFFFF-1} {testobj deprecated} {
- teststringobj set 1 abcde
- teststringobj range 1 1 [expr {0x7FFFFFFF-1}]
-} bcde
-test stringObj-16.9 {Tcl_GetRange: last = 0x7FFFFFFF-1} {testobj deprecated} {
- teststringobj set 1 abcde
- teststringobj range 1 1 [expr {0x7FFFFFFF - 1}]
-} bcde
-test stringObj-16.10 {Tcl_GetRange: first = last = 0x7FFFFFFF-1} {testobj deprecated} {
- teststringobj set 1 abcde
- teststringobj range 1 [expr {0x7FFFFFFF-1}] [expr {0x7FFFFFFF-1}]
-} {}
-test stringObj-16.11 {Tcl_GetRange: first = last = 0x7FFFFFFF-1} {testobj deprecated} {
- teststringobj set 1 abcde
- set i [expr {0x7FFFFFFF - 1}]
- teststringobj range 1 $i $i
-} {}
-
if {[testConstraint testobj]} {
testobj freeallvars
}
@@ -529,7 +485,3 @@ if {[testConstraint testobj]} {
# cleanup
::tcltest::cleanupTests
return
-
-# Local Variables:
-# mode: tcl
-# End: