diff --git a/src-libinterfacetests/Main.hs b/src-libinterfacetests/Main.hs index 8334328..973755e 100644 --- a/src-libinterfacetests/Main.hs +++ b/src-libinterfacetests/Main.hs @@ -26,7 +26,7 @@ main = hspec $ do , " ]" ] output <- liftIO $ parsePrintModule staticDefaultConfig input - input `shouldSatisfy` \_ -> case output of - Right x | x == expected -> True - _ -> False + hush output `shouldBe` Just expected +hush :: Either a b -> Maybe b +hush = either (const Nothing) Just diff --git a/src-literatetests/Main.hs b/src-literatetests/Main.hs index ae469e3..458566b 100644 --- a/src-literatetests/Main.hs +++ b/src-literatetests/Main.hs @@ -188,10 +188,10 @@ roundTripEqual c t = `shouldReturn` Right (PPTextWrapper t) newtype PPTextWrapper = PPTextWrapper Text - deriving Eq + deriving (Eq, Show) -instance Show PPTextWrapper where - show (PPTextWrapper t) = "\n" ++ Text.unpack t +-- instance Show PPTextWrapper where +-- show (PPTextWrapper t) = "\n" ++ Text.unpack t -- brittany-next-binding --columns 160 -- brittany-next-binding { lconfig_indentPolicy: IndentPolicyLeft } diff --git a/src/Language/Haskell/Brittany/Internal.hs b/src/Language/Haskell/Brittany/Internal.hs index 8c22c8d..a90ac27 100644 --- a/src/Language/Haskell/Brittany/Internal.hs +++ b/src/Language/Haskell/Brittany/Internal.hs @@ -313,7 +313,7 @@ parsePrintModule configWithDebugs inputText = runExceptT $ do True -> not $ null errsWarns if hasErrors then throwE $ errsWarns - else pure $ TextL.toStrict outputTextL + else pure $ TextL.toStrict $ TextL.snoc outputTextL '\n' @@ -398,7 +398,7 @@ parsePrintModuleTests conf filename input = do else lift $ pPrintModuleAndCheck moduleConf perItemConf anns parsedModule if null errs - then pure $ TextL.toStrict $ ltext + then pure $ TextL.toStrict $ TextL.snoc ltext '\n' else let errStrs = errs <&> \case