Skip to content
Permalink
Browse files

revive nim-lang#10228: fix nim-lang#9880 index out of bounds, remaini…

…ng cases
  • Loading branch information...
timotheecour committed Feb 9, 2019
1 parent ec40c05 commit fcabb1e1d0abcfd78601eb92b76ea0bc985bfea7
Showing with 7 additions and 26 deletions.
  1. +7 −26 tests/exception/tindexerrorformatbounds.nim
@@ -1,6 +1,4 @@
import os
import strutils

import os, osproc, strutils

const characters = "abcdefghijklmnopqrstuvwxyz"
var s: string
@@ -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 fcabb1e

Please sign in to comment.
You can’t perform that action at this time.