aboutsummaryrefslogtreecommitdiff
path: root/aoc2023/test/day6/day6_test.gleam
diff options
context:
space:
mode:
authorHJ <thechairman@thechairman.info>2023-12-06 01:03:37 -0500
committerHJ <thechairman@thechairman.info>2023-12-06 01:03:37 -0500
commitba0980cb60c4373d28619a4b200b7375ac381791 (patch)
tree3645fa77c03b2d22bf4efc1007e0c44ffa37b52c /aoc2023/test/day6/day6_test.gleam
parentac7a889dea39a6479d2d6c47b2b8304bae60e49c (diff)
downloadgleam_aoc-ba0980cb60c4373d28619a4b200b7375ac381791.tar.gz
gleam_aoc-ba0980cb60c4373d28619a4b200b7375ac381791.zip
day 6 gleam/racket complete
Diffstat (limited to 'aoc2023/test/day6/day6_test.gleam')
-rw-r--r--aoc2023/test/day6/day6_test.gleam50
1 files changed, 50 insertions, 0 deletions
diff --git a/aoc2023/test/day6/day6_test.gleam b/aoc2023/test/day6/day6_test.gleam
new file mode 100644
index 0000000..c551993
--- /dev/null
+++ b/aoc2023/test/day6/day6_test.gleam
@@ -0,0 +1,50 @@
+import gleam/list
+import showtime/tests/should
+import adglent.{type Example, Example}
+import day6/solve
+
+type Problem1AnswerType =
+ String
+
+type Problem2AnswerType =
+ String
+
+/// Add examples for part 1 here:
+/// ```gleam
+///const part1_examples: List(Example(Problem1AnswerType)) = [Example("some input", "")]
+/// ```
+const part1_examples: List(Example(Problem1AnswerType)) = [
+ Example(
+ "Time: 7 15 30
+Distance: 9 40 200",
+ "288",
+ ),
+]
+
+/// Add examples for part 2 here:
+/// ```gleam
+///const part2_examples: List(Example(Problem2AnswerType)) = [Example("some input", "")]
+/// ```
+const part2_examples: List(Example(Problem2AnswerType)) = [
+ Example(
+ "Time: 7 15 30
+Distance: 9 40 200",
+ "71503",
+ ),
+]
+
+pub fn part1_test() {
+ part1_examples
+ |> should.not_equal([])
+ use example <- list.map(part1_examples)
+ solve.part1(example.input)
+ |> should.equal(example.answer)
+}
+
+pub fn part2_test() {
+ part2_examples
+ |> should.not_equal([])
+ use example <- list.map(part2_examples)
+ solve.part2(example.input)
+ |> should.equal(example.answer)
+}