Skip to content

Commit

Permalink
Restyled by fourmolu (#1458)
Browse files Browse the repository at this point in the history
Co-authored-by: Restyled.io <[email protected]>
  • Loading branch information
restyled-io[bot] and restyled-commits authored Aug 23, 2023
1 parent 72d0241 commit 428863d
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions test/integration/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ import Swarm.Doc.Gen qualified as DocGen
import Swarm.Game.CESK (emptyStore, getTickNumber, initMachine)
import Swarm.Game.Entity (EntityMap, lookupByName)
import Swarm.Game.Failure (SystemFailure)
import Swarm.Game.Robot (LogEntry, defReqs, equippedDevices, leText, machine, robotContext, robotLog, waitingUntil, LogSource (..))
import Swarm.Game.Log (ErrorLevel (..), leSource)
import Swarm.Game.Robot (LogEntry, LogSource (..), defReqs, equippedDevices, leText, machine, robotContext, robotLog, waitingUntil)
import Swarm.Game.Scenario (Scenario)
import Swarm.Game.State (
GameState,
Expand All @@ -40,18 +41,19 @@ import Swarm.Game.State (
activeRobots,
baseRobot,
messageQueue,
notificationsContent,
robotMap,
ticks,
waitingRobots,
winCondition,
winSolution, notificationsContent,
winSolution,
)
import Swarm.Game.Step (gameTick)
import Swarm.Game.World.Typecheck (WorldMap)
import Swarm.Language.Context qualified as Ctx
import Swarm.Language.Pipeline (ProcessedTerm (..), processTerm)
import Swarm.Language.Pretty (prettyString)
import Swarm.TUI.Model (RuntimeState, defaultAppOpts, gameState, stdEntityMap, userScenario, worlds, eventLog, runtimeState)
import Swarm.TUI.Model (RuntimeState, defaultAppOpts, eventLog, gameState, runtimeState, stdEntityMap, userScenario, worlds)
import Swarm.TUI.Model.StateUpdate (constructAppState, initPersistentState)
import Swarm.TUI.Model.UI (UIState)
import Swarm.Util (acquireAllWithExt)
Expand All @@ -61,7 +63,6 @@ import System.Timeout (timeout)
import Test.Tasty (TestTree, defaultMain, testGroup)
import Test.Tasty.HUnit (Assertion, assertBool, assertFailure, testCase)
import Witch (into)
import Swarm.Game.Log (leSource, ErrorLevel (..))

isUnparseableTest :: (FilePath, String) -> Bool
isUnparseableTest (fp, _) = "_Validation" `elem` splitDirectories fp
Expand Down Expand Up @@ -94,11 +95,13 @@ testNoLoadingErrors r =
testCase "Test runtime log does not contain errors" (checkNoRuntimeErrors r)

checkNoRuntimeErrors :: RuntimeState -> IO ()
checkNoRuntimeErrors r =
checkNoRuntimeErrors r =
forM_ (r ^. eventLog . notificationsContent) $ \e ->
case e ^. leSource of
ErrorTrace l | l >= Warning -> assertFailure $
show l <> " was produced during loading: " <> T.unpack (e ^. leText)
ErrorTrace l
| l >= Warning ->
assertFailure $
show l <> " was produced during loading: " <> T.unpack (e ^. leText)
_ -> pure ()

exampleTests :: [(FilePath, String)] -> TestTree
Expand Down

0 comments on commit 428863d

Please sign in to comment.