You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
nimout spec seems to just check that each line in nimout is a contiguous substring of a line in compilation output. This is way too lax for being usable, as shown here:
each line in nimout should be a complete line in compilation output (no substring match)
it's ok to have unmatched lines in output (useful for new warnings/hints etc)
order cannot change
each matched line should only be used once
EDIT: this is maybe the thing to fix (in testament.nim):
procgreedyOrderedSubsetLines*(lhs, rhs: string): bool=## returns true if each stripped line in `lhs` appears in rhs, using a greedy matching.let rhs = rhs.strip
var currentPos =0for line in lhs.strip.splitLines:
currentPos = rhs.find(line.strip, currentPos)
if currentPos <0:
returnfalsereturntrue
procgreedyOrderedSubsetLines*(lhs, rhs: string): bool=## returns true if each stripped line in `lhs` appears in rhs, using a greedy matching.let rhs = rhs.strip
var currentPos =0for line in lhs.strip.splitLines:
currentPos = rhs.find(line.strip, currentPos)
if currentPos <0:
returnfalsereturntrue
nimout spec seems to just check that each line in nimout is a contiguous substring of a line in compilation output. This is way too lax for being usable, as shown here:
Example 1
XDG_CONFIG_HOME= nim r testament/testament.nim r tests/misc/t11682b.nim
Current Output
PASS: tests/misc/t11682b.nim c
Expected Output
fails
Example 2
this can go horribly wrong, see #16698 (comment)
Possible Solution
EDIT: this is maybe the thing to fix (in testament.nim):
Additional Information
The text was updated successfully, but these errors were encountered: