[commit: haddock] master: Add arbitrary-indent spec test for parser. (3536512)

git at git.haskell.org git at git.haskell.org
Wed Jul 8 08:38:53 UTC 2015


Repository : ssh://git@git.haskell.org/haddock

On branch  : master
Link       : http://git.haskell.org/haddock.git/commitdiff/3536512c4658a51b72a9b879f372fa08ed402d9c

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

commit 3536512c4658a51b72a9b879f372fa08ed402d9c
Author: Łukasz Hanuszczak <lukasz.hanuszczak at gmail.com>
Date:   Wed Jun 3 02:11:31 2015 +0200

    Add arbitrary-indent spec test for parser.


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

3536512c4658a51b72a9b879f372fa08ed402d9c
 .../test/Documentation/Haddock/ParserSpec.hs            | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/haddock-library/test/Documentation/Haddock/ParserSpec.hs b/haddock-library/test/Documentation/Haddock/ParserSpec.hs
index 9161160..2ef414f 100644
--- a/haddock-library/test/Documentation/Haddock/ParserSpec.hs
+++ b/haddock-library/test/Documentation/Haddock/ParserSpec.hs
@@ -696,6 +696,23 @@ spec = do
                            ]
           <> DocOrderedList [ DocParagraph "baz" ]
 
+      it "allows arbitrary initial indent of a list" $ do
+        unlines
+          [ "     * foo"
+          , "     * bar"
+          , ""
+          , "         * quux"
+          , ""
+          , "     * baz"
+          ]
+        `shouldParseTo`
+        DocUnorderedList
+          [ DocParagraph "foo"
+          , DocParagraph "bar"
+            <> DocUnorderedList [ DocParagraph "quux" ]
+          , DocParagraph "baz"
+          ]
+
       it "definition lists can come back to top level with a different list" $ do
         "[foo]: foov\n\n    [bar]: barv\n\n1. baz" `shouldParseTo`
           DocDefList [ ("foo", "foov"



More information about the ghc-commits mailing list