@@ -71,7 +71,7 @@ import Swarm.Game.Step.Path.Type
7171import Swarm.Game.Step.Validate (badErrorsInLogs , playUntilWin )
7272import Swarm.Game.Tick (getTickNumber )
7373import Swarm.Language.Phase (Raw )
74- import Swarm.Language.Pipeline (processTerm )
74+ import Swarm.Language.Pipeline (processSource , requireNonEmptyTerm )
7575import Swarm.Log
7676import Swarm.Pretty (prettyString )
7777import Swarm.TUI.Model (
@@ -96,7 +96,6 @@ import Test.Tasty.ExpectedFailure (expectFailBecause)
9696import Test.Tasty.HUnit (Assertion , assertBool , assertEqual , assertFailure , testCase )
9797import TestFormat
9898import TestRecipeCoverage
99- import Witch (into )
10099
101100isUnparseableTest :: FilePath -> Bool
102101isUnparseableTest fp = " _Validation" `elem` splitDirectories fp
@@ -149,11 +148,10 @@ exampleTests = testGroup "Test example" . map exampleTest
149148
150149exampleTest :: FilePath -> TestTree
151150exampleTest 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
158156scenarioParseTests :: ScenarioInputs -> [FilePath ] -> TestTree
159157scenarioParseTests scenarioInputs inputs =
0 commit comments