@@ -17,8 +17,8 @@ import Data.Text (Text)
1717import Data.Text qualified as T
1818import Data.Text.Encoding qualified as T
1919import Swarm.Failure (SystemFailure )
20- import Swarm.Language.Load (SyntaxWithImports (.. ))
2120import Swarm.Language.JSON ()
21+ import Swarm.Language.Load (SyntaxWithImports (.. ))
2222import Swarm.Language.Parser (readTerm )
2323import Swarm.Language.Parser.QQ (tyQ )
2424import Swarm.Language.Pipeline (processSource )
@@ -766,18 +766,18 @@ testLanguagePipeline =
766766 " Import #2540"
767767 [ testCase
768768 " simple import"
769- ( valid " import \" data/test/import/a.sw\" ; pure (a + 1)" )
769+ (valid " import \" data/test/import/a.sw\" ; pure (a + 1)" )
770770 , testCase
771771 " recursive import - unused"
772- ( valid " import \" data/test/import/b.sw\" ; pure (b + 1)" )
772+ (valid " import \" data/test/import/b.sw\" ; pure (b + 1)" )
773773 , testCase
774774 " recursive import - used"
775- ( valid " import \" data/test/import/d.sw\" ; pure (d + 1)" )
775+ (valid " import \" data/test/import/d.sw\" ; pure (d + 1)" )
776776 , testCase
777777 " recursive import is not re-exported"
778778 ( process
779- " import \" data/test/import/f.sw\" ; pure (f + g)"
780- " 1:43: Unbound variable g"
779+ " import \" data/test/import/f.sw\" ; pure (f + g)"
780+ " 1:43: Unbound variable g"
781781 )
782782 ]
783783 ]
@@ -788,15 +788,16 @@ testLanguagePipeline =
788788 process = processCompare T. isPrefixOf
789789
790790 processCompare :: (Text -> Text -> Bool ) -> Text -> Text -> Assertion
791- processCompare cmp code expect = runError @ SystemFailure (processSource code Nothing ) >>= \ case
792- Left e
793- | not (T. null expect) && cmp expect (prettyText e) -> pure ()
794- | otherwise ->
795- error $
796- " Unexpected failure:\n\n " <> show (prettyText e) <> " \n\n Expected:\n\n " <> show expect <> " \n "
797- Right _
798- | expect == " " -> pure ()
799- | otherwise -> error " Unexpected success"
791+ processCompare cmp code expect =
792+ runError @ SystemFailure (processSource code Nothing ) >>= \ case
793+ Left e
794+ | not (T. null expect) && cmp expect (prettyText e) -> pure ()
795+ | otherwise ->
796+ error $
797+ " Unexpected failure:\n\n " <> show (prettyText e) <> " \n\n Expected:\n\n " <> show expect <> " \n "
798+ Right _
799+ | expect == " " -> pure ()
800+ | otherwise -> error " Unexpected success"
800801
801802-- | Check round tripping of term from and to text, then test ToJSON/FromJSON.
802803roundTripTerm :: Text -> Assertion
0 commit comments