aboutsummaryrefslogtreecommitdiff
path: root/aoc2023/build/packages/adglent/src/priv/templates
diff options
context:
space:
mode:
authorJ.J <thechairman@thechairman.info>2024-05-30 21:50:02 -0400
committerJ.J <thechairman@thechairman.info>2024-05-30 21:50:02 -0400
commit612fd986ab1e00b6d34dc1937136250e08e89325 (patch)
treea3c93952040c6afdf348b5831619a45db7ba0a2e /aoc2023/build/packages/adglent/src/priv/templates
parent231c2b688d1e6cf0846d46e883da30e042a9c6cf (diff)
downloadgleam_aoc-612fd986ab1e00b6d34dc1937136250e08e89325.tar.gz
gleam_aoc-612fd986ab1e00b6d34dc1937136250e08e89325.zip
cleanup
Diffstat (limited to 'aoc2023/build/packages/adglent/src/priv/templates')
-rw-r--r--aoc2023/build/packages/adglent/src/priv/templates/solution.gleam27
-rw-r--r--aoc2023/build/packages/adglent/src/priv/templates/test_main.gleam7
-rw-r--r--aoc2023/build/packages/adglent/src/priv/templates/testfile_gleeunit.gleam41
-rw-r--r--aoc2023/build/packages/adglent/src/priv/templates/testfile_showtime.gleam41
4 files changed, 116 insertions, 0 deletions
diff --git a/aoc2023/build/packages/adglent/src/priv/templates/solution.gleam b/aoc2023/build/packages/adglent/src/priv/templates/solution.gleam
new file mode 100644
index 0000000..96085c3
--- /dev/null
+++ b/aoc2023/build/packages/adglent/src/priv/templates/solution.gleam
@@ -0,0 +1,27 @@
+pub const template = "
+import adglent.{First, Second}
+import gleam/io
+
+pub fn part1(input: String) {
+ todo as \"Implement solution to part 1\"
+}
+
+pub fn part2(input: String) {
+ todo as \"Implement solution to part 2\"
+}
+
+pub fn main() {
+ let assert Ok(part) = adglent.get_part()
+ let assert Ok(input) = adglent.get_input(\"{{ day }}\")
+ case part {
+ First ->
+ part1(input)
+ |> adglent.inspect
+ |> io.println
+ Second ->
+ part2(input)
+ |> adglent.inspect
+ |> io.println
+ }
+}
+"
diff --git a/aoc2023/build/packages/adglent/src/priv/templates/test_main.gleam b/aoc2023/build/packages/adglent/src/priv/templates/test_main.gleam
new file mode 100644
index 0000000..27548d3
--- /dev/null
+++ b/aoc2023/build/packages/adglent/src/priv/templates/test_main.gleam
@@ -0,0 +1,7 @@
+pub const template = "
+import showtime
+
+pub fn main() {
+ showtime.main()
+}
+"
diff --git a/aoc2023/build/packages/adglent/src/priv/templates/testfile_gleeunit.gleam b/aoc2023/build/packages/adglent/src/priv/templates/testfile_gleeunit.gleam
new file mode 100644
index 0000000..a1d56f6
--- /dev/null
+++ b/aoc2023/build/packages/adglent/src/priv/templates/testfile_gleeunit.gleam
@@ -0,0 +1,41 @@
+pub const template = "
+import gleam/list
+import gleeunit/should
+import adglent.{type Example, Example}
+import day{{ day }}/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)) = []
+
+/// Add examples for part 2 here:
+/// ```gleam
+///const part2_examples: List(Example(Problem2AnswerType)) = [Example(\"some input\", \"\")]
+/// ```
+const part2_examples: List(Example(Problem2AnswerType)) = []
+
+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)
+}
+
+"
diff --git a/aoc2023/build/packages/adglent/src/priv/templates/testfile_showtime.gleam b/aoc2023/build/packages/adglent/src/priv/templates/testfile_showtime.gleam
new file mode 100644
index 0000000..699feb2
--- /dev/null
+++ b/aoc2023/build/packages/adglent/src/priv/templates/testfile_showtime.gleam
@@ -0,0 +1,41 @@
+pub const template = "
+import gleam/list
+import showtime/tests/should
+import adglent.{type Example, Example}
+import day{{ day }}/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)) = []
+
+/// Add examples for part 2 here:
+/// ```gleam
+///const part2_examples: List(Example(Problem2AnswerType)) = [Example(\"some input\", \"\")]
+/// ```
+const part2_examples: List(Example(Problem2AnswerType)) = []
+
+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)
+}
+
+"