fixed the io tests so they run as intended

There is however a problem with the unittest. It does output
colors even if stdout isn't a tty, so the test still fails.
This commit is contained in:
Simon Hafner
2011-12-31 19:07:31 +01:00
parent 9bd2be36c8
commit ad0ea47f43
3 changed files with 5 additions and 7 deletions

View File

@@ -140,10 +140,9 @@ proc rejectThreadTests(r: var TResults, options: string) =
# ------------------------- IO tests -----------------------------------
proc compileIOTests(r: var TResults, options: string) =
compileSingleTest(r, "tests/system/helpers/readall_echo.nim", options)
proc runIOTests(r: var TResults, options: string) =
# We need readall_echo to be compiled for this test to run.
compileSingleTest(r, "tests/system/helpers/readall_echo", options)
runSingleTest(r, "tests/system/io", options)
# ------------------------- register special tests here -----------------------
@@ -163,6 +162,5 @@ proc compileSpecialTests(r: var TResults, options: string) =
compileSingleTest(r, "compiler/c2nim/c2nim.nim", options)
compileSingleTest(r, "compiler/pas2nim/pas2nim.nim", options)
compileIOTests(r, options)
compileDLLTests(r, options)

View File

@@ -1 +1,2 @@
echo(stdin.readAll)
when isMainModule:
echo(stdin.readAll)

View File

@@ -1,11 +1,10 @@
discard """output: '''[OK] stdin
[OK] file'''
disabled: true
"""
import
unittest, osproc, streams, os, "helpers/readall_echo"
unittest, osproc, streams, os
const STRING_DATA = """Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet."""
const TEST_FILE = "tests/testdata/string"