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 output <- liftIO $ parsePrintModule staticDefaultConfig input
input `shouldSatisfy` \_ -> case output of hush output `shouldBe` Just expected
Right x | x == expected -> True
_ -> False
hush :: Either a b -> Maybe b
hush = either (const Nothing) Just

View File

@ -188,10 +188,10 @@ roundTripEqual c t =
`shouldReturn` Right (PPTextWrapper t) `shouldReturn` Right (PPTextWrapper t)
newtype PPTextWrapper = PPTextWrapper Text newtype PPTextWrapper = PPTextWrapper Text
deriving Eq deriving (Eq, Show)
instance Show PPTextWrapper where -- instance Show PPTextWrapper where
show (PPTextWrapper t) = "\n" ++ Text.unpack t -- show (PPTextWrapper t) = "\n" ++ Text.unpack t
-- brittany-next-binding --columns 160 -- brittany-next-binding --columns 160
-- brittany-next-binding { lconfig_indentPolicy: IndentPolicyLeft } -- brittany-next-binding { lconfig_indentPolicy: IndentPolicyLeft }

View File

@ -313,7 +313,7 @@ parsePrintModule configWithDebugs inputText = runExceptT $ do
True -> not $ null errsWarns True -> not $ null errsWarns
if hasErrors if hasErrors
then throwE $ errsWarns 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 else lift
$ pPrintModuleAndCheck moduleConf perItemConf anns parsedModule $ pPrintModuleAndCheck moduleConf perItemConf anns parsedModule
if null errs if null errs
then pure $ TextL.toStrict $ ltext then pure $ TextL.toStrict $ TextL.snoc ltext '\n'
else else
let let
errStrs = errs <&> \case errStrs = errs <&> \case