From 48a078a6f3158470abbb2746a71d4659c768949e Mon Sep 17 00:00:00 2001 From: Simon Hengel Date: Tue, 9 Oct 2012 12:04:20 +0200 Subject: Add unit tests for properties --- tests/unit-tests/parsetests.hs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests/unit-tests') diff --git a/tests/unit-tests/parsetests.hs b/tests/unit-tests/parsetests.hs index 4a6c8d90..1f923aa0 100644 --- a/tests/unit-tests/parsetests.hs +++ b/tests/unit-tests/parsetests.hs @@ -63,6 +63,17 @@ spec = do it "accepts an optional label" $ do parse "" `shouldBe` (Just . DocParagraph $ hyperlink "http://example.com/" (Just "some link") `mappend` DocString "\n") + + context "when parsing properties" $ do + it "can parse a single property" $ do + parse "prop> 23 == 23" `shouldBe` (Just $ DocProperty "23 == 23") + + it "can parse a multiple subsequent properties" $ do + let input = unlines [ + "prop> 23 == 23" + , "prop> 42 == 42" + ] + parse input `shouldBe` (Just $ DocProperty "23 == 23" `DocAppend` DocProperty "42 == 42") where hyperlink :: String -> Maybe String -> Doc RdrName hyperlink url = DocHyperlink . Hyperlink url -- cgit v1.2.3