diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/Haddock/Parser/UtilSpec.hs | 2 | ||||
-rw-r--r-- | test/Haddock/ParserSpec.hs | 23 |
2 files changed, 12 insertions, 13 deletions
diff --git a/test/Haddock/Parser/UtilSpec.hs b/test/Haddock/Parser/UtilSpec.hs index acb88220..9e1e8de1 100644 --- a/test/Haddock/Parser/UtilSpec.hs +++ b/test/Haddock/Parser/UtilSpec.hs @@ -5,7 +5,7 @@ import Test.Hspec import Data.Either import Data.Attoparsec.ByteString.Char8 -import Haddock.Parser.Util +import Haddock.Parser main :: IO () main = hspec spec diff --git a/test/Haddock/ParserSpec.hs b/test/Haddock/ParserSpec.hs index f44b7d0f..53fef943 100644 --- a/test/Haddock/ParserSpec.hs +++ b/test/Haddock/ParserSpec.hs @@ -26,20 +26,19 @@ deriving instance Show a => Show (Doc a) deriving instance Eq a => Eq (Header a) deriving instance Eq a => Eq (Doc a) -instance IsString RdrName where - fromString = mkVarUnqual . fsLit - -instance IsString (Doc RdrName) where +instance IsString (Doc String) where fromString = DocString instance IsString a => IsString (Maybe a) where fromString = Just . fromString -parseParas :: String -> Doc RdrName -parseParas = Parse.parseParas dynFlags +parseParas :: String -> Doc String +parseParas = Parse.toRegular . Parse.parseParas + +parseString :: String -> Doc String +parseString = Parse.toRegular . Parse.parseString + -parseString :: String -> Doc RdrName -parseString = Parse.parseString dynFlags main :: IO () main = hspec spec @@ -48,7 +47,7 @@ spec :: Spec spec = before initStaticOpts $ do describe "parseString" $ do let infix 1 `shouldParseTo` - shouldParseTo :: String -> Doc RdrName -> Expectation + shouldParseTo :: String -> Doc String -> Expectation shouldParseTo input ast = parseString input `shouldBe` ast it "is total" $ do @@ -96,7 +95,7 @@ spec = before initStaticOpts $ do "don't use apostrophe's in the wrong place's" context "when parsing URLs" $ do - let hyperlink :: String -> Maybe String -> Doc RdrName + let hyperlink :: String -> Maybe String -> Doc String hyperlink url = DocHyperlink . Hyperlink url it "parses a URL" $ do @@ -154,7 +153,7 @@ spec = before initStaticOpts $ do hyperlink "http://example.com/" Nothing <> "? Some other sentence." context "when parsing pictures" $ do - let picture :: String -> Maybe String -> Doc RdrName + let picture :: String -> Maybe String -> Doc String picture uri = DocPic . Picture uri it "parses a simple picture" $ do @@ -310,7 +309,7 @@ spec = before initStaticOpts $ do describe "parseParas" $ do let infix 1 `shouldParseTo` - shouldParseTo :: String -> Doc RdrName -> Expectation + shouldParseTo :: String -> Doc String -> Expectation shouldParseTo input ast = parseParas input `shouldBe` ast it "is total" $ do |