Append final newline
parent
116930ac2b
commit
515595b432
|
@ -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
|
||||
|
|
|
@ -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 }
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue