aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSimon Hengel <sol@typeful.net>2012-10-09 12:04:20 +0200
committerSimon Hengel <sol@typeful.net>2012-10-09 13:40:21 +0200
commit48a078a6f3158470abbb2746a71d4659c768949e (patch)
treecccba99edf4a9044a1aa12fdaf8ca450c2bf3f85 /tests
parent0cf6d611f3af05c7b54d83747847d372a3ebf017 (diff)
Add unit tests for properties
Diffstat (limited to 'tests')
-rw-r--r--tests/unit-tests/parsetests.hs11
1 files changed, 11 insertions, 0 deletions
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 "<http://example.com/ some link>" `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