diff options
author | Timothee Cour <timothee.cour2@gmail.com> | 2020-05-19 00:41:31 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-19 09:41:31 +0200 |
commit | e909486e5cde5a4a77cd6f21b42fc9ab38ec2ae6 (patch) | |
tree | 7367a3774091f156d91e46cd4c292441ab3da46e /compiler | |
parent | 27741d6a5c9ec87a6938b2928ae54b22bc93d9be (diff) | |
download | Nim-e909486e5cde5a4a77cd6f21b42fc9ab38ec2ae6.tar.gz |
trunner was not actually being tested in non-CTFFI mode; minor testament cleanups (#14377)
* use check * trunner now works with cpp * cleanup: move compiler/unittest_light => stdtest/unittest_light * fix tests/readme.md * remove deadcode references to rodfiles * fix for windows
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/rodimpl.nim | 2 | ||||
-rw-r--r-- | compiler/unittest_light.nim | 38 |
2 files changed, 2 insertions, 38 deletions
diff --git a/compiler/rodimpl.nim b/compiler/rodimpl.nim index 8ee7ae564..417241930 100644 --- a/compiler/rodimpl.nim +++ b/compiler/rodimpl.nim @@ -916,6 +916,8 @@ proc loadNode*(g: ModuleGraph; module: PSym): PNode = replay(g, module, result) proc setupModuleCache*(g: ModuleGraph) = + ## historical note: there used to be a `rodfiles` dir with special tests + ## for incremental compilation via symbol files. This was likely replaced by ic. if g.config.symbolFiles == disabledSf: return g.recordStmt = recordStmt let dbfile = getNimcacheDir(g.config) / RelativeFile"rodfiles.db" diff --git a/compiler/unittest_light.nim b/compiler/unittest_light.nim deleted file mode 100644 index d9842b399..000000000 --- a/compiler/unittest_light.nim +++ /dev/null @@ -1,38 +0,0 @@ -# note: consider merging tests/assert/testhelper.nim here. - -proc mismatch*[T](lhs: T, rhs: T): string = - ## Simplified version of `unittest.require` that satisfies a common use case, - ## 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. - proc replaceInvisible(s: string): string = - for a in s: - case a - of '\n': result.add "\\n\n" - else: result.add a - - proc quoted(s: string): string = result.addQuoted s - - result.add "\n" - result.add "lhs:{" & replaceInvisible( - $lhs) & "}\nrhs:{" & replaceInvisible($rhs) & "}\n" - when compiles(lhs.len): - if lhs.len != rhs.len: - result.add "lhs.len: " & $lhs.len & " rhs.len: " & $rhs.len & "\n" - when compiles(lhs[0]): - var i = 0 - while i < lhs.len and i < rhs.len: - if lhs[i] != rhs[i]: break - i.inc - result.add "first mismatch index: " & $i & "\n" - if i < lhs.len and i < rhs.len: - result.add "lhs[i]: {" & quoted($lhs[i]) & "}\nrhs[i]: {" & quoted( - $rhs[i]) & "}\n" - result.add "lhs[0..<i]:{" & replaceInvisible($lhs[ - 0..<i]) & "}" - -proc assertEquals*[T](lhs: T, rhs: T) = - when false: # can be useful for debugging to see all that's fed to this. - echo "----" & $lhs - if lhs!=rhs: - doAssert false, mismatch(lhs, rhs) |