diff options
Diffstat (limited to 'tests/exception/tindexerrorformatbounds.nim')
-rw-r--r-- | tests/exception/tindexerrorformatbounds.nim | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/tests/exception/tindexerrorformatbounds.nim b/tests/exception/tindexerrorformatbounds.nim deleted file mode 100644 index 7563c5ffa..000000000 --- a/tests/exception/tindexerrorformatbounds.nim +++ /dev/null @@ -1,31 +0,0 @@ -import os, osproc, strutils - -const characters = "abcdefghijklmnopqrstuvwxyz" -var s: string - -# # chcks.nim:23 -# # test formatErrorIndexBound returns correct bounds -block: - s = characters - try: - discard s[0..999] - except IndexError: - let msg = getCurrentExceptionMsg() - let expected = "index $# not in 0 .. $#" % [$len(s), $(len(s)-1)] - doAssert msg.contains expected, $(msg, expected) - -block: - try: - discard paramStr(999) - except IndexError: - let msg = getCurrentExceptionMsg() - let expected = "index 999 not in 0 .. 0" - doAssert msg.contains expected, $(msg, expected) - -block: - const nim = getCurrentCompilerExe() - for i in 1..4: - let (outp, errC) = execCmdEx("$# e tests/exception/testindexerroroutput.nims test$#" % [nim, $i]) - let expected = "index 3 not in 0 .. 2" - doAssert errC != 0 - doAssert outp.contains expected, $(outp, errC, expected, i) |