diff --git a/Aoc2024/Day01/Parser.lean b/Aoc2024/Day01/Parser.lean index fee6e8f..abeebc1 100644 --- a/Aoc2024/Day01/Parser.lean +++ b/Aoc2024/Day01/Parser.lean @@ -1,4 +1,5 @@ import Aoc2024.Utils +import Aoc2024.Day01.Examples import Std open Std.Internal.Parsec.String open Std.Internal.Parsec @@ -13,4 +14,11 @@ private def inputParser : Parser (List (Int × Int)) := sepBy lineParser (String def parseLines : String -> Except String (List (Int × Int)) := inputParser.run -#guard parseLines "23 24\n14 13" == Except.ok [(23, 24), (14, 13)] +#guard parseLines exampleInput == Except.ok [ + (3, 4), + (4, 3), + (2, 5), + (1, 3), + (3, 9), + (3, 3) +] diff --git a/Aoc2024/Day02/Parser.lean b/Aoc2024/Day02/Parser.lean index 58f89e2..6792047 100644 --- a/Aoc2024/Day02/Parser.lean +++ b/Aoc2024/Day02/Parser.lean @@ -1,5 +1,6 @@ import Aoc2024.Utils import Aoc2024.Day02.Types +import Aoc2024.Day02.Examples import Std open Std.Internal.Parsec.String open Std.Internal.Parsec @@ -10,4 +11,11 @@ private def inputParser : Parser (List Report) := sepBy reportParser (String.ski def parseReports : String -> Except String (List Report) := inputParser.run -#guard parseReports "7 6 4 2 1\n1 2 7 8 9" == Except.ok [[7, 6, 4, 2, 1], [1, 2, 7, 8, 9]] +#guard parseReports exampleInput == Except.ok [ + [7, 6, 4, 2, 1], + [1, 2, 7, 8, 9], + [9, 7, 6, 2, 1], + [1, 3, 2, 4, 5], + [8, 6, 4, 4, 1], + [1, 3, 6, 7, 9] +]