mirror of
https://github.com/nim-lang/Nim.git
synced 2026-08-29 10:01:39 +00:00
enable experimental:strictDefs (#24225)
This commit is contained in:
@@ -38,6 +38,7 @@ proc splitTestFile*(file: string): tuple[cat: string, path: string] =
|
||||
## At least one directory is required in the path, to use as a category name
|
||||
runnableExamples:
|
||||
doAssert splitTestFile("tests/fakedir/tfakename.nim") == ("fakedir", "tests/fakedir/tfakename.nim".unixToNativePath)
|
||||
result = ("", "")
|
||||
for p in file.parentDirs(inclusive = false):
|
||||
let parent = p.parentDir
|
||||
if parent.lastPathPart == testsFname:
|
||||
|
||||
@@ -6,13 +6,18 @@ proc mismatch*[T](lhs: T, rhs: T): string =
|
||||
## while avoiding pulling too many dependencies. On failure, diagnostic
|
||||
## information is provided that in particular makes it easy to spot
|
||||
## whitespace mismatches and where the mismatch is.
|
||||
result = ""
|
||||
|
||||
proc replaceInvisible(s: string): string =
|
||||
result = ""
|
||||
for a in s:
|
||||
case a
|
||||
of '\n': result.add "\\n\n"
|
||||
else: result.add a
|
||||
|
||||
proc quoted(s: string): string = result.addQuoted s
|
||||
proc quoted(s: string): string =
|
||||
result = ""
|
||||
result.addQuoted s
|
||||
|
||||
result.add '\n'
|
||||
result.add "lhs:{" & replaceInvisible(
|
||||
|
||||
Reference in New Issue
Block a user