summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/assemble.test80
-rw-r--r--tests/binary.test12
2 files changed, 39 insertions, 53 deletions
diff --git a/tests/assemble.test b/tests/assemble.test
index 8c50500..d417d4b 100644
--- a/tests/assemble.test
+++ b/tests/assemble.test
@@ -1524,61 +1524,35 @@ test assemble-14.7 {incrArrayStkImm} {
# assemble-15 - listIndexImm
-test assemble-15.1 {listIndexImm - wrong # args} {
- -body {
- assemble {listIndexImm}
- }
- -returnCodes error
- -match glob
- -result {wrong # args*}
-}
-test assemble-15.2 {listIndexImm - wrong # args} {
- -body {
- assemble {listIndexImm too many}
- }
- -returnCodes error
- -match glob
- -result {wrong # args*}
-}
-test assemble-15.3 {listIndexImm - bad substitution} {
- -body {
- list [catch {assemble {listIndexImm $foo}} result] $result $::errorCode
- }
- -result {1 {assembly code may not contain substitutions} {TCL ASSEM NOSUBST}}
- -cleanup {unset result}
-}
-test assemble-15.4 {listIndexImm - invalid index} {
- -body {
- assemble {listIndexImm rubbish}
- }
- -returnCodes error
- -match glob
- -result {bad index "rubbish"*}
-}
-test assemble-15.5 {listIndexImm} {
- -body {
- assemble {push {a b c}; listIndexImm 2}
- }
- -result c
-}
-test assemble-15.6 {listIndexImm} {
- -body {
- assemble {push {a b c}; listIndexImm end-1}
- }
- -result b
-}
-test assemble-15.7 {listIndexImm} {
- -body {
- assemble {push {a b c}; listIndexImm end}
- }
- -result c
-}
-test assemble-15.8 {listIndexImm} {
+test assemble-15.1 {listIndexImm - wrong # args} -body {
+ assemble {listIndexImm}
+} -returnCodes error -match glob -result {wrong # args*}
+test assemble-15.2 {listIndexImm - wrong # args} -body {
+ assemble {listIndexImm too many}
+} -returnCodes error -match glob -result {wrong # args*}
+test assemble-15.3 {listIndexImm - bad substitution} -body {
+ list [catch {assemble {listIndexImm $foo}} result] $result $::errorCode
+} -cleanup {
+ unset result
+} -result {1 {assembly code may not contain substitutions} {TCL ASSEM NOSUBST}}
+test assemble-15.4 {listIndexImm - invalid index} -body {
+ assemble {listIndexImm rubbish}
+} -returnCodes error -match glob -result {bad index "rubbish"*}
+test assemble-15.5 {listIndexImm} -body {
+ assemble {push {a b c}; listIndexImm 2}
+} -result c
+test assemble-15.6 {listIndexImm} -body {
+ assemble {push {a b c}; listIndexImm end-1}
+} -result b
+test assemble-15.7 {listIndexImm} -body {
+ assemble {push {a b c}; listIndexImm end}
+} -result c
+test assemble-15.8 {listIndexImm} -body {
assemble {push {a b c}; listIndexImm end+2}
-} {}
-test assemble-15.9 {listIndexImm} {
+} -result {}
+test assemble-15.9 {listIndexImm} -body {
assemble {push {a b c}; listIndexImm -1-1}
-} {}
+} -result {}
# assemble-16 - invokeStk
diff --git a/tests/binary.test b/tests/binary.test
index 973240f..8b5ad18 100644
--- a/tests/binary.test
+++ b/tests/binary.test
@@ -2918,6 +2918,18 @@ test binary-78.1 {unicode (out of BMP) to byte-array conversion, bug-[bd94500678
set str {}
} -result {}
+
+testConstraint testsetbytearraylength \
+ [expr {"testsetbytearraylength" in [info commands]}]
+
+test binary-79.1 {Tcl_SetByteArrayLength} testsetbytearraylength {
+ testsetbytearraylength [string cat A B C] 1
+} A
+test binary-79.2 {Tcl_SetByteArrayLength} testsetbytearraylength {
+ testsetbytearraylength [string cat \u0141 B C] 1
+} A
+
+
# ----------------------------------------------------------------------
# cleanup