Skip to content

Commit 1a6d62f

Browse files
committed
fix integration tests
1 parent 6edc1d4 commit 1a6d62f

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

test/integration/Main.hs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ import Swarm.Game.Step.Path.Type
7171
import Swarm.Game.Step.Validate (badErrorsInLogs, playUntilWin)
7272
import Swarm.Game.Tick (getTickNumber)
7373
import Swarm.Language.Phase (Raw)
74-
import Swarm.Language.Pipeline (processTerm)
74+
import Swarm.Language.Pipeline (processSource, requireNonEmptyTerm)
7575
import Swarm.Log
7676
import Swarm.Pretty (prettyString)
7777
import Swarm.TUI.Model (
@@ -96,7 +96,6 @@ import Test.Tasty.ExpectedFailure (expectFailBecause)
9696
import Test.Tasty.HUnit (Assertion, assertBool, assertEqual, assertFailure, testCase)
9797
import TestFormat
9898
import TestRecipeCoverage
99-
import Witch (into)
10099

101100
isUnparseableTest :: FilePath -> Bool
102101
isUnparseableTest fp = "_Validation" `elem` splitDirectories fp
@@ -149,11 +148,10 @@ exampleTests = testGroup "Test example" . map exampleTest
149148

150149
exampleTest :: FilePath -> TestTree
151150
exampleTest path =
152-
testCase ("processTerm for contents of " ++ show path) $ do
153-
assertFailure "TODO"
154-
155-
-- value <- undefined processTerm <$> T.readFile path
156-
-- either (assertFailure . into @String) (const $ return ()) value
151+
testCase ("processSource for contents of " ++ show path) $ do
152+
content <- T.readFile path
153+
res <- runError @SystemFailure (processSource content Nothing >>= requireNonEmptyTerm)
154+
either (assertFailure . prettyString) (const $ pure ()) res
157155

158156
scenarioParseTests :: ScenarioInputs -> [FilePath] -> TestTree
159157
scenarioParseTests scenarioInputs inputs =

0 commit comments

Comments
 (0)