From b58ccf39a730dba009abbbae19cb55e0200d37ac Mon Sep 17 00:00:00 2001 From: Steve Bennett Date: Sat, 2 May 2020 16:43:01 +1000 Subject: jim.c: Fix UpdateStringOfIndex() In case the index is invalid, the string should contain -MAX_INT Signed-off-by: Steve Bennett --- tests/coverage.test | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests') 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} -- cgit v1.1