testament: error instead of silently overwrite a spec (#16166)
This commit is contained in:
parent
d29eddf92a
commit
6114df3c24
5 changed files with 51 additions and 27 deletions
|
|
@ -402,9 +402,8 @@ proc codegenCheck(test: TTest, target: TTarget, spec: TSpec, expectedMsg: var st
|
|||
try:
|
||||
let genFile = generatedFile(test, target)
|
||||
let contents = readFile(genFile).string
|
||||
let check = spec.ccodeCheck
|
||||
if check.len > 0:
|
||||
if check[0] == '\\':
|
||||
for check in spec.ccodeCheck:
|
||||
if check.len > 0 and check[0] == '\\':
|
||||
# little hack to get 'match' support:
|
||||
if not contents.match(check.peg):
|
||||
given.err = reCodegenFailure
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue