on master help sign in
Clean up the output from the test suite
commit1c72d108ad57a10c14ce3ffba1e40440dbeb6be8 authorNeil Mitchell <ndmitchell@gmail.com> dateWed 30 Nov 2016, 19:08 (10 years ago) parent38aced2
1 file changed+4−7
src/Main.hs+4−7
src/Main.hs+4−7
@@ -23,18 +23,15 @@ examples =
2323main :: IO ()
2424main = do
2525 forM_ examples $ \(parses, src) -> do
26− print src
2726 case parse src of
2827 Left err -> when parses $ fail $ "Unexpected parse failure, " ++ show err
2928 Right doc -> do
3029 unless parses $ fail "Unexpected parse success"
3130 checkFind doc
3231 let r = render doc
33− print r
34− print $ rerender doc
35− when (r /= rerender doc) $ fail "Different rerender"
32+ r === rerender doc
3633 let Right d = parse r
37− when (r /= render d) $ fail "Different after rerendering"
34+ r === render d
3835
3936 let Right doc = parse "<test id=\"1\" extra=\"2\" /><test id=\"2\" /><b><test id=\"3\" /></b><test id=\"4\" /><test />"
4037 map name (children doc) === ["test","test","b","test","test"]
@@ -52,7 +49,7 @@ main = do
5249 [c] <- return $ childrenBy doc "test"
5350 forM_ attrs $ \a -> attributeBy c a === Just (Attribute a a)
5451 forM_ ["missing","gone","nothing"] $ \a -> attributeBy c a === Nothing
55− putStrLn "Done"
52+ putStrLn "\nSuccess"
5653
5754
5855checkFind :: Node -> IO ()
@@ -65,7 +62,7 @@ checkFind n = do
6562 mapM_ checkFind $ children n
6663
6764
68−a === b = if a == b then putStrLn "success" else fail "mismatch"
65+a === b = if a == b then putChar '.' else fail "mismatch"
6966
7067rerender :: Node -> BS.ByteString
7168rerender = inside