This commit is contained in:
George Thomas 2025-12-02 14:27:14 +00:00
parent 60acecb993
commit 40f7a8ee9a

View File

@ -32,11 +32,11 @@ main =
puzzleTest :: FilePath -> Puzzle -> TestTree puzzleTest :: FilePath -> Puzzle -> TestTree
puzzleTest t Puzzle{number, parser, parts} = puzzleTest t Puzzle{number, parser, parts} =
withResource (parseFile $ "inputs/" <> t <> "/" <> pt) mempty \input -> withResource (parseFile $ "inputs/" <> t <> "/" <> pt) mempty \input ->
testGroup pt $ testGroup pt $
zip (map show [1 :: Int ..]) parts <&> \(n, pp) -> zip (map show [1 :: Int ..]) parts <&> \(n, pp) ->
goldenVsString n ("outputs/" <> t <> "/" <> pt <> "/" <> n) $ goldenVsString n ("outputs/" <> t <> "/" <> pt <> "/" <> n) $
BL.fromStrict . encodeUtf8 . pp <$> input BL.fromStrict . encodeUtf8 . pp <$> input
where where
pt = show number pt = show number
parseFile fp = parseFile fp =