Skip to content

Commit

Permalink
less noisy output from Rhino tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Arjun Guha committed Dec 23, 2008
1 parent ed3e863 commit 66224f7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/Rhino.hs
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,12 @@ commandIO path args stdinStr = do
B.hPutStr hStdin stdinStr
stdoutStr <- B.hGetContents hStdout
stderrStr <- hGetContents hStderr
hPutStrLn stderr (take 50 stderrStr) -- echo errors to our stderr
hPutStrLn stderr stderrStr -- echo errors to our stderr
exitCode <- waitForProcess hProcess
case exitCode of
ExitSuccess -> return (Just stdoutStr)
ExitFailure n -> do
B.hPutStrLn stdout stdoutStr -- echo for errors
hPutStrLn stderr $ "Sub-process died with exit code " ++ show n
return Nothing

Expand All @@ -69,7 +70,9 @@ testRhino src str = TestCase $ do
let src' = src ++ " (pretty-printed)"
lhs <- ((rhino src') . B.pack . pretty . (parse src)) str
rhs <- rhino src (B.pack str)
assertEqual ("testRhino on " ++ src) lhs rhs
if lhs == rhs
then return ()
else assertFailure ("testRhino failed on " ++ src)


main = do
Expand Down
2 changes: 2 additions & 0 deletions tests/parse-pretty/numbers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
var x = 23;
var y = 23.0;

0 comments on commit 66224f7

Please sign in to comment.