Skip to content

Commit

Permalink
revive nim-lang#10228: fix nim-lang#9880 index out of bounds, remaini…
Browse files Browse the repository at this point in the history
…ng cases
  • Loading branch information
timotheecour committed Feb 9, 2019
1 parent 69fe3a9 commit 49bd1d7
Showing 1 changed file with 7 additions and 26 deletions.
33 changes: 7 additions & 26 deletions tests/exception/tindexerrorformatbounds.nim
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import os
import strutils

import os, osproc, strutils

const characters = "abcdefghijklmnopqrstuvwxyz"
var s: string
Expand All @@ -24,29 +22,12 @@ block:
let expected = "(i:999) <= (n:0)"
doAssert msg.contains expected

static:
block:
const nim = getCurrentCompilerExe()

block:
let ret = gorgeEx(nim & " e testindexerroroutput.nims test1")
let expected = "(i:3) <= (n:2)"
doAssert ret.exitCode != 0
doAssert ret.output.contains expected

block:
let ret = gorgeEx(nim & " e testindexerroroutput.nims test2")
let expected = "(i:3) <= (n:2)"
doAssert ret.exitCode != 0
doAssert ret.output.contains expected

block:
let ret = gorgeEx(nim & " e testindexerroroutput.nims test3")
let expected = "(i:3) <= (n:2)"
doAssert ret.exitCode != 0
doAssert ret.output.contains expected

block:
let ret = gorgeEx(nim & " e testindexerroroutput.nims test4")
for i in 1..4:
let (outp, errC) = execCmdEx("$# e tests/exception/testindexerroroutput.nims test$#" % [nim, $i])
let expected = "(i:3) <= (n:2)"
doAssert ret.exitCode != 0
doAssert ret.output.contains expected
doAssert errC != 0
echo outp
doAssert outp.contains expected, $(outp, errC, expected, i)

0 comments on commit 49bd1d7

Please sign in to comment.