fixes #2286
This commit is contained in:
parent
5a21892da0
commit
f514be0772
4 changed files with 77 additions and 22 deletions
|
|
@ -148,7 +148,11 @@ proc codegenCheck(test: TTest, check: string, given: var TSpec) =
|
|||
let genFile = generatedFile(path, name, test.target)
|
||||
echo genFile
|
||||
let contents = readFile(genFile).string
|
||||
if contents.find(check.peg) < 0:
|
||||
if check[0] == '\\':
|
||||
# little hack to get 'match' support:
|
||||
if not contents.match(check.peg):
|
||||
given.err = reCodegenFailure
|
||||
elif contents.find(check.peg) < 0:
|
||||
given.err = reCodegenFailure
|
||||
except ValueError:
|
||||
given.err = reInvalidPeg
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue