Commit 229e6bf1 authored by Hans-Peter Deifel's avatar Hans-Peter Deifel 🐢
Browse files

Fix whitespace

parent c7fc3340
...@@ -86,13 +86,13 @@ testFileMinimize mini = ...@@ -86,13 +86,13 @@ testFileMinimize mini =
process file `shouldReturn` minimized process file `shouldReturn` minimized
where where
process :: FilePath -> IO String process :: FilePath -> IO String
process file = process file =
P.readFile P.defaultConfig file >>= P.readFile P.defaultConfig file >>=
\case \case
Left err -> return err Left err -> return err
Right (f, (symTab, enc)) -> do Right (f, (symTab, enc)) -> do
part <- stToIO (refine (Proxy :: Proxy (Desorted SomeFunctor)) enc True) part <- stToIO (refine (Proxy :: Proxy (Desorted SomeFunctor)) enc True)
let let
(enc', symTab') = minimize f enc symTab part (enc', symTab') = minimize f enc symTab part
return (LT.unpack . Build.toLazyText $ Build.fromText (printParseableFunctor f) return (LT.unpack . Build.toLazyText $ Build.fromText (printParseableFunctor f)
...@@ -103,18 +103,18 @@ testFileMinimize mini = ...@@ -103,18 +103,18 @@ testFileMinimize mini =
testFileMinimizeIdentity :: FilePath -> Spec testFileMinimizeIdentity :: FilePath -> Spec
testFileMinimizeIdentity file = testFileMinimizeIdentity file =
specify ("minimizeIdentity " <> file) $ do specify ("minimizeIdentity " <> file) $ do
P.readFile P.defaultConfig file >>= P.readFile P.defaultConfig file >>=
\case \case
Left err -> expectationFailure $ "initialParse: " <> err Left err -> expectationFailure $ "initialParse: " <> err
Right (f, (symTab, enc)) -> do Right (f, (symTab, enc)) -> do
part <- stToIO (refine (Proxy :: Proxy (Desorted SomeFunctor)) enc True) part <- stToIO (refine (Proxy :: Proxy (Desorted SomeFunctor)) enc True)
let let
(enc', symTab') = minimize f enc symTab part (enc', symTab') = minimize f enc symTab part
coalgebra = Build.fromText (printParseableFunctor f) coalgebra = Build.fromText (printParseableFunctor f)
<> "\n\n" <> "\n\n"
<> printEncoding enc' (anonymizeSymbols symTab') (sortTable f) <> printEncoding enc' (anonymizeSymbols symTab') (sortTable f)
reparsed = P.parseCoalgebra P.defaultConfig "(minimized)" $ LT.toStrict (Build.toLazyText coalgebra) reparsed = P.parseCoalgebra P.defaultConfig "(minimized)" $ LT.toStrict (Build.toLazyText coalgebra)
case reparsed of case reparsed of
Left err -> expectationFailure $ "parseMinimized: " <> err Left err -> expectationFailure $ "parseMinimized: " <> err
...@@ -123,7 +123,7 @@ testFileMinimizeIdentity file = ...@@ -123,7 +123,7 @@ testFileMinimizeIdentity file =
let let
(enc''', symTab''') = minimize f' enc'' symTab'' part' (enc''', symTab''') = minimize f' enc'' symTab'' part'
Build.fromText (printParseableFunctor f) Build.fromText (printParseableFunctor f)
<> "\n\n" <> "\n\n"
<> (printEncoding enc''' (anonymizeSymbols symTab''') (sortTable f')) `shouldBe` <> (printEncoding enc''' (anonymizeSymbols symTab''') (sortTable f')) `shouldBe`
coalgebra coalgebra
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment