summaryrefslogtreecommitdiffstats
path: root/tests/string.test
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2021-04-09 15:19:51 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2021-04-09 15:19:51 (GMT)
commitaa4f7bcd47ef35e83a3a5a6c3f16398bf3758e49 (patch)
tree3437f219dfea47d335f00237bd046b9a809c3a7f /tests/string.test
parent1f4a8eb5d1a8d6fddf8571fc5694d3b527799df6 (diff)
downloadtcl-aa4f7bcd47ef35e83a3a5a6c3f16398bf3758e49.zip
tcl-aa4f7bcd47ef35e83a3a5a6c3f16398bf3758e49.tar.gz
tcl-aa4f7bcd47ef35e83a3a5a6c3f16398bf3758e49.tar.bz2
Deprecate/remove "string bytelength"
Diffstat (limited to 'tests/string.test')
-rw-r--r--tests/string.test19
1 files changed, 10 insertions, 9 deletions
diff --git a/tests/string.test b/tests/string.test
index 72aeb43..99c1517 100644
--- a/tests/string.test
+++ b/tests/string.test
@@ -33,6 +33,7 @@ testConstraint testindexobj [expr {[info commands testindexobj] ne {}}]
testConstraint testevalex [expr {[info commands testevalex] ne {}}]
testConstraint utf16 [expr {[string length \U010000] == 2}]
testConstraint testbytestring [llength [info commands testbytestring]]
+testConstraint nodep [info exists tcl_precision]
# Used for constraining memory leak tests
testConstraint memory [llength [info commands memory]]
@@ -72,9 +73,9 @@ if {$noComp} {
}
-test string-1.1.$noComp {error conditions} {
+test string-1.1.$noComp {error conditions} -body {
list [catch {run {string gorp a b}} msg] $msg
-} {1 {unknown or ambiguous subcommand "gorp": must be bytelength, cat, compare, equal, first, index, insert, is, last, length, map, match, range, repeat, replace, reverse, tolower, totitle, toupper, trim, trimleft, trimright, wordend, or wordstart}}
+} -match glob -result {1 {unknown or ambiguous subcommand "gorp": must be *cat, compare, equal, first, index, insert, is, last, length, map, match, range, repeat, replace, reverse, tolower, totitle, toupper, trim, trimleft, trimright, wordend, or wordstart}}
test string-1.2.$noComp {error conditions} {
list [catch {run {string}} msg] $msg
} {1 {wrong # args: should be "string subcommand ?arg ...?"}}
@@ -1035,16 +1036,16 @@ test string-7.16.$noComp {string last, start index} {
run {string last Üa ÜadÜad end-1}
} 3
-test string-8.1.$noComp {string bytelength} {
+test string-8.1.$noComp {string bytelength} nodep {
list [catch {run {string bytelength}} msg] $msg
} {1 {wrong # args: should be "string bytelength string"}}
-test string-8.2.$noComp {string bytelength} {
+test string-8.2.$noComp {string bytelength} nodep {
list [catch {run {string bytelength a b}} msg] $msg
} {1 {wrong # args: should be "string bytelength string"}}
-test string-8.3.$noComp {string bytelength} {
+test string-8.3.$noComp {string bytelength} nodep {
run {string bytelength "\xC7"}
} 2
-test string-8.4.$noComp {string bytelength} {
+test string-8.4.$noComp {string bytelength} nodep {
run {string b ""}
} 0
@@ -1827,9 +1828,9 @@ test string-19.3.$noComp {string trimleft, unicode default} {
test string-20.1.$noComp {string trimright errors} {
list [catch {run {string trimright}} msg] $msg
} {1 {wrong # args: should be "string trimright string ?chars?"}}
-test string-20.2.$noComp {string trimright errors} {
+test string-20.2.$noComp {string trimright errors} -body {
list [catch {run {string trimg a}} msg] $msg
-} {1 {unknown or ambiguous subcommand "trimg": must be bytelength, cat, compare, equal, first, index, insert, is, last, length, map, match, range, repeat, replace, reverse, tolower, totitle, toupper, trim, trimleft, trimright, wordend, or wordstart}}
+} -match glob -result {1 {unknown or ambiguous subcommand "trimg": must be *cat, compare, equal, first, index, insert, is, last, length, map, match, range, repeat, replace, reverse, tolower, totitle, toupper, trim, trimleft, trimright, wordend, or wordstart}}
test string-20.3.$noComp {string trimright} {
run {string trimright " XYZ "}
} { XYZ}
@@ -1949,7 +1950,7 @@ test string-21.25.$noComp {string trimright, unicode} {
test string-22.1.$noComp {string wordstart} -body {
list [catch {run {string word a}} msg] $msg
-} -result {1 {unknown or ambiguous subcommand "word": must be bytelength, cat, compare, equal, first, index, insert, is, last, length, map, match, range, repeat, replace, reverse, tolower, totitle, toupper, trim, trimleft, trimright, wordend, or wordstart}}
+} -match glob -result {1 {unknown or ambiguous subcommand "word": must be *cat, compare, equal, first, index, insert, is, last, length, map, match, range, repeat, replace, reverse, tolower, totitle, toupper, trim, trimleft, trimright, wordend, or wordstart}}
test string-22.2.$noComp {string wordstart} -body {
list [catch {run {string wordstart a}} msg] $msg
} -result {1 {wrong # args: should be "string wordstart string index"}}