@@ -15,7 +15,8 @@ import qualified Test.Hspec.QuickCheck
1515import qualified Test.QuickCheck as QC
1616import Text.Parser.Char
1717import Text.Parser.Combinators
18- import qualified Text.PrettyPrint.ANSI.Leijen as PP
18+ import qualified Prettyprinter as PP
19+ import qualified Prettyprinter.Render.String as PP
1920import Data.Typeable (Typeable )
2021import qualified Data.HashSet as HashSet
2122import Data.List (intercalate )
@@ -43,7 +44,7 @@ spec = Test.Hspec.QuickCheck.modifyMaxDiscardRatio (const 20) $ do
4344 ParameterDeclarationWithTypeNames typeNames ty <-
4445 arbitraryParameterDeclarationWithTypeNames unCIdentifier
4546 return $ isGoodType ty QC. ==>
46- let ty' = assertParse (cCParserContext True typeNames) parameter_declaration (prettyOneLine ty )
47+ let ty' = assertParse (cCParserContext True typeNames) parameter_declaration (prettyOneLine ( PP. pretty ty) )
4748 in Types. untangleParameterDeclaration ty == Types. untangleParameterDeclaration ty'
4849 Hspec. it " parses everything which is pretty-printable (Haskell)" $ do
4950#if MIN_VERSION_QuickCheck(2,9,0)
@@ -54,7 +55,7 @@ spec = Test.Hspec.QuickCheck.modifyMaxDiscardRatio (const 20) $ do
5455 ParameterDeclarationWithTypeNames typeNames ty <-
5556 arbitraryParameterDeclarationWithTypeNames unHaskellIdentifier
5657 return $ isGoodHaskellIdentifierType typeNames ty QC. ==>
57- let ty' = assertParse (haskellCParserContext True typeNames) parameter_declaration (prettyOneLine ty )
58+ let ty' = assertParse (haskellCParserContext True typeNames) parameter_declaration (prettyOneLine ( PP. pretty ty) )
5859 in Types. untangleParameterDeclaration ty == Types. untangleParameterDeclaration ty'
5960
6061------------------------------------------------------------------------
@@ -68,8 +69,8 @@ assertParse ctx p s =
6869 Left err -> error $ " Parse error (assertParse): " ++ show err ++ " parsed string " ++ show s ++ " with type names " ++ show (cpcTypeNames ctx)
6970 Right x -> x
7071
71- prettyOneLine :: PP. Pretty a => a -> String
72- prettyOneLine x = PP. displayS ( PP. renderCompact ( PP. pretty x)) " "
72+ prettyOneLine :: PP. Doc ann -> String
73+ prettyOneLine x = PP. renderString $ PP. layoutCompact x
7374
7475isGoodType :: ParameterDeclaration i -> Bool
7576isGoodType ty =
0 commit comments