diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2017-03-02 12:23:35 +0100 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2017-03-02 12:23:35 +0100 |
commit | 3e7b04683c7912cc49d05444187ca3bde7bc18aa (patch) | |
tree | 7fd4c7c12e0b51f381b81d9c9ce2b4387c5514e8 /tools | |
parent | ee13c8014bfb6a3100b8e0d3150b755ba36b44e4 (diff) | |
download | Nim-3e7b04683c7912cc49d05444187ca3bde7bc18aa.tar.gz |
make tests green again
Diffstat (limited to 'tools')
-rw-r--r-- | tools/nimsuggest/tester.nim | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/tools/nimsuggest/tester.nim b/tools/nimsuggest/tester.nim index 451af32f5..a80c0b3d7 100644 --- a/tools/nimsuggest/tester.nim +++ b/tools/nimsuggest/tester.nim @@ -212,8 +212,8 @@ proc doReport(filename, answer, resp: string; report: var string) = var hasDiff = false for i in 0..min(resp.len-1, answer.len-1): if resp[i] != answer[i]: - report.add "\n Expected: " & resp.substr(i) - report.add "\n But got: " & answer.substr(i) + report.add "\n Expected: " & resp.substr(i, i+200) + report.add "\n But got: " & answer.substr(i, i+200) hasDiff = true break if not hasDiff: @@ -233,15 +233,17 @@ proc runEpcTest(filename: string): int = let outp = p.outputStream let inp = p.inputStream var report = "" - #var a = newStringOfCap(120) try: # read the port number: - #discard outp.readLine(a) - var i = 0 - while not osproc.hasData(p) and i < 100: - os.sleep(50) - inc i - let a = outp.readAll().strip() + when defined(posix): + var a = newStringOfCap(120) + discard outp.readLine(a) + else: + var i = 0 + while not osproc.hasData(p) and i < 100: + os.sleep(50) + inc i + let a = outp.readAll().strip() let port = parseInt(a) var socket = newSocket() socket.connect("localhost", Port(port)) @@ -298,7 +300,7 @@ proc runTest(filename: string): int = proc main() = var failures = 0 when false: - let x = getAppDir() / "tests/twithin_macro.nim" + let x = getAppDir() / "tests/tdot1.nim" let xx = expandFilename x failures += runEpcTest(xx) else: |