diff --git a/haskell/Puzzles/Day4.hs b/haskell/Puzzles/Day4.hs index b5bc351..d5503e6 100644 --- a/haskell/Puzzles/Day4.hs +++ b/haskell/Puzzles/Day4.hs @@ -27,13 +27,13 @@ puzzle = drawGrid (mkGrid input <&> \case InEmpty -> OutEmpty; InRoll -> OutRoll) `shouldBe` t describe "frames" do let frames = Seq.fromList $ takeUntil noneAccessible frameStream - -- note that `nFrames = Seq.length frames - 1`, but we don't define it as such - -- since that would force the expensive evaluation during test tree construction, messing up reporting let nFrames = if isRealData then 58 else 9 for_ [0 .. nFrames] \n -> it (show n) . pureGoldenTextFile (path <> "frames/" <> show n) $ maybe "frame list too short!" drawGrid (Seq.lookup n frames) it "end" do + -- we can't actually define `nFrames` this way as it would messing up reporting, + -- due to forcing the expensive evaluation during test tree construction Seq.length frames `shouldBe` (nFrames + 1) Just g <- pure $ Seq.lookup nFrames frames (g `shouldSatisfyNamed` "accessible tile found") noneAccessible