From ea6ca4158c7acf45150691bf90a071ecfc989fdc Mon Sep 17 00:00:00 2001 From: George Thomas Date: Tue, 2 Dec 2025 08:53:18 +0000 Subject: [PATCH] Minor refactor --- app/Main.hs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/Main.hs b/app/Main.hs index e61dc13..244e334 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -21,13 +21,15 @@ main = puzzleTest :: Puzzle a -> TestTree puzzleTest p = - testGroup (show p.number) $ + testGroup pt $ ["examples", "real"] <&> \t -> - withResource (maybe (fail "parse failure") pure . p.parse =<< readFile ("inputs/" <> t <> "/" <> show p.number)) mempty \input -> + withResource (maybe (fail "parse failure") pure . p.parse =<< readFile ("inputs/" <> t <> "/" <> pt)) mempty \input -> testGroup t $ [("1", p.part1), ("2", p.part2)] <&> \(n, pp) -> - goldenVsString n ("outputs/" <> t <> "/" <> show p.number <> "/" <> n) $ + goldenVsString n ("outputs/" <> t <> "/" <> pt <> "/" <> n) $ BL.fromStrict . encodeUtf8 . pp.solve <$> input + where + pt = show p.number data Puzzle input = Puzzle { number :: Word