summaryrefslogtreecommitdiffstats
path: root/tests/subst.test
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2014-07-16 10:02:02 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2014-07-16 10:02:02 (GMT)
commit54c72fdcab114a768b54bd1dfd06912b79dc0da0 (patch)
tree17150e3e7f9f402236d0267308e10b72b4cc438a /tests/subst.test
parent19e38811559271a3d6c390847ee1f8a206d65a50 (diff)
downloadtcl-54c72fdcab114a768b54bd1dfd06912b79dc0da0.zip
tcl-54c72fdcab114a768b54bd1dfd06912b79dc0da0.tar.gz
tcl-54c72fdcab114a768b54bd1dfd06912b79dc0da0.tar.bz2
Modify the "gettimes" test-command to use the Tcl_Obj API.
New "testbytestring" command which can be used to replace the (to-be-deprecated) "bytestring" command from tcltest and/or the "indentity" encoding. Adapt many testcases to use the "testbytestring" command.
Diffstat (limited to 'tests/subst.test')
-rw-r--r--tests/subst.test12
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/subst.test b/tests/subst.test
index 498512d..747438e 100644
--- a/tests/subst.test
+++ b/tests/subst.test
@@ -15,6 +15,10 @@ if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest 2.1
namespace import -force ::tcltest::*
}
+::tcltest::loadTestedCommands
+catch [list package require -exact Tcltest [info patchlevel]]
+
+testConstraint testbytestring [llength [info commands testbytestring]]
test subst-1.1 {basics} -returnCodes error -body {
subst
@@ -32,16 +36,16 @@ test subst-2.2 {simple strings} {
test subst-2.3 {simple strings} {
subst abcdefg
} abcdefg
-test subst-2.4 {simple strings} {
+test subst-2.4 {simple strings} testbytestring {
# Tcl Bug 685106
- subst [bytestring bar\x00soom]
-} [bytestring bar\x00soom]
+ subst [testbytestring bar\x00soom]
+} [testbytestring bar\x00soom]
test subst-3.1 {backslash substitutions} {
subst {\x\$x\[foo bar]\\}
} "x\$x\[foo bar]\\"
test subst-3.2 {backslash substitutions with utf chars} {
- # 'j' is just a char that doesn't mean anything, and \344 is 'ä'
+ # 'j' is just a char that doesn't mean anything, and \344 is '�'
# that also doesn't mean anything, but is multi-byte in UTF-8.
list [subst \j] [subst \\j] [subst \\344] [subst \\\344]
} "j j \344 \344"