tester works again

This commit is contained in:
Araq 2014-05-30 17:04:39 +02:00
commit bea1761da1
2 changed files with 5 additions and 5 deletions

View file

@ -1,9 +1,9 @@
discard """ discard """
line: 7 line: 9
errormsg: "'spawn' takes a call expression" errormsg: "'spawn' takes a call expression"
cmd: "nimrod $target --threads:on $options $file" cmd: "nimrod $target --threads:on $options $file"
""" """
import threadpool import threadpool
spawn(1) let foo = spawn(1)

View file

@ -11,7 +11,7 @@
import import
parseutils, strutils, pegs, os, osproc, streams, parsecfg, json, parseutils, strutils, pegs, os, osproc, streams, parsecfg, json,
marshal, backend, parseopt, specs, htmlgen, browsers, terminal, sequtils, marshal, backend, parseopt, specs, htmlgen, browsers, terminal,
algorithm algorithm
const const
@ -152,7 +152,7 @@ proc codegenCheck(test: TTest, check: string, given: var TSpec) =
given.err = reCodeNotFound given.err = reCodeNotFound
proc makeDeterministic(s: string): string = proc makeDeterministic(s: string): string =
var x = toSeq(s.lines) var x = splitLines(s)
sort(x, system.cmp) sort(x, system.cmp)
result = join(x, "\n") result = join(x, "\n")
@ -200,7 +200,7 @@ proc testSpec(r: var TResults, test: TTest) =
var bufB = strip(buf.string) var bufB = strip(buf.string)
if expected.sortoutput: bufB = makeDeterministic(bufB) if expected.sortoutput: bufB = makeDeterministic(bufB)
if bufB != strip(expected.outp): if bufB != strip(expected.outp):
if not (expected.substr and expected.outp in buf.string): if not (expected.substr and expected.outp in bufB):
given.err = reOutputsDiffer given.err = reOutputsDiffer
if given.err == reSuccess: if given.err == reSuccess:
codeGenCheck(test, expected.ccodeCheck, given) codeGenCheck(test, expected.ccodeCheck, given)