nimout now consistently uses nimoutCheck (#16189)

This commit is contained in:
Timothee Cour 2020-12-01 12:12:40 -08:00 • committed by GitHub
commit e0b4f05053
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 29 additions and 20 deletions

View file

@ -1,4 +1,5 @@
import std/private/miscdollars
import std/strutils
template flakyAssert*(cond: untyped, msg = "", notifySuccess = true) =
## API to deal with flaky or failing tests. This avoids disabling entire tests
@ -23,3 +24,13 @@ template flakyAssert*(cond: untyped, msg = "", notifySuccess = true) =
msg2.add " FLAKY_FAILURE "
msg2.add $expr & " " & msg
echo msg2
proc greedyOrderedSubsetLines*(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 = 0
for line in lhs.strip.splitLines:
currentPos = rhs.find(line.strip, currentPos)
if currentPos < 0:
return false
return true