aboutsummaryrefslogtreecommitdiff
path: root/tests/coverage.test
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2020-05-02 16:43:01 +1000
committerSteve Bennett <steveb@workware.net.au>2020-05-04 21:58:38 +1000
commitb58ccf39a730dba009abbbae19cb55e0200d37ac (patch)
treea48eb4289f3b10b4ca53535bb4eec8b9f68b5bc6 /tests/coverage.test
parent72c78e31ab153f318e431c81cfc4b9d08701a515 (diff)
downloadjimtcl-b58ccf39a730dba009abbbae19cb55e0200d37ac.zip
jimtcl-b58ccf39a730dba009abbbae19cb55e0200d37ac.tar.gz
jimtcl-b58ccf39a730dba009abbbae19cb55e0200d37ac.tar.bz2
jim.c: Fix UpdateStringOfIndex()
In case the index is invalid, the string should contain -MAX_INT Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'tests/coverage.test')
-rw-r--r--tests/coverage.test8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/coverage.test b/tests/coverage.test
index b99b273..95d6969 100644
--- a/tests/coverage.test
+++ b/tests/coverage.test
@@ -164,6 +164,14 @@ test index-4 {index > INT_MAX} debug-invstr {
lindex {a b c} $x
} {}
+test index-5 {update string of index} debug-invstr {
+ set x -1
+ lindex {a b c} $x
+ debug invstr $x
+ # x is now of index type with no string rep
+ set x
+} {-2147483647}
+
test cmd-1 {standard -commands} jim {
expr {"length" in [string -commands]}
} {1}