Append final newline

pull/357/head
Taylor Fausak 2021-10-30 16:28:34 +00:00 committed by GitHub
parent 116930ac2b
commit 515595b432
3 changed files with 8 additions and 8 deletions

View File

@ -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

View File

@ -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 }

View File

@ -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