diff options
author | Steve Bennett <steveb@workware.net.au> | 2020-07-12 06:40:36 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2020-07-12 06:48:43 +1000 |
commit | da293a1eef2ddd709f10b63744032302ca3597d3 (patch) | |
tree | 6a51da2ea65e95cd101362b6fc4713a5b8d5b16f /tests/string.test | |
parent | 4e2cdacaad9473324807009b125907c76a7c7569 (diff) | |
download | jimtcl-da293a1eef2ddd709f10b63744032302ca3597d3.zip jimtcl-da293a1eef2ddd709f10b63744032302ca3597d3.tar.gz jimtcl-da293a1eef2ddd709f10b63744032302ca3597d3.tar.bz2 |
string last: fix segfault with invalid index
[string last foo bar -1] gave segfault due to missing
check for invalid index.
Fixes #161
Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'tests/string.test')
-rw-r--r-- | tests/string.test | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/string.test b/tests/string.test index 5a22229..3624565 100644 --- a/tests/string.test +++ b/tests/string.test @@ -449,6 +449,9 @@ test string-7.5 {string last} { test string-7.6 {string last} { string las x xxxx123xx345x678 } 12 +test string-7.7 {string last, bad index} { + string last ba badbad -1 +} -1 test string-7.13 {string last, start index} { ## Constrain to last 'a' should work string last ba badbad end-1 |