[commit: haddock] ghc-7.6: Add unit tests for properties (48a078a)

Simon Hengel <[email protected]>
Newsgroups gmane.comp.lang.haskell.cvs.ghc
Message-ID <[email protected]>
Repository : ssh://darcs.haskell.org//srv/darcs/haddock

On branch  : ghc-7.6

http://hackage.haskell.org/trac/ghc/changeset/48a078a6f3158470abbb2746a71d4659c768949e

>---------------------------------------------------------------

commit 48a078a6f3158470abbb2746a71d4659c768949e
Author: Simon Hengel <[email protected]>
Date:   Tue Oct 9 12:04:20 2012 +0200

    Add unit tests for properties

>---------------------------------------------------------------

 tests/unit-tests/parsetests.hs |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/tests/unit-tests/parsetests.hs b/tests/unit-tests/parsetests.hs
index 4a6c8d9..1f923aa 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.