aboutsummaryrefslogtreecommitdiff
path: root/aoc2023/build/packages/adglent/src/showtime/tests/test.gleam
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/showtime/tests/test.gleam
parent231c2b688d1e6cf0846d46e883da30e042a9c6cf (diff)
downloadgleam_aoc-612fd986ab1e00b6d34dc1937136250e08e89325.tar.gz
gleam_aoc-612fd986ab1e00b6d34dc1937136250e08e89325.zip
cleanup
Diffstat (limited to 'aoc2023/build/packages/adglent/src/showtime/tests/test.gleam')
-rw-r--r--aoc2023/build/packages/adglent/src/showtime/tests/test.gleam57
1 files changed, 57 insertions, 0 deletions
diff --git a/aoc2023/build/packages/adglent/src/showtime/tests/test.gleam b/aoc2023/build/packages/adglent/src/showtime/tests/test.gleam
new file mode 100644
index 0000000..730f943
--- /dev/null
+++ b/aoc2023/build/packages/adglent/src/showtime/tests/test.gleam
@@ -0,0 +1,57 @@
+import showtime/tests/should
+import showtime/tests/meta.{type Meta}
+import gleam/io
+
+pub type Test {
+ Test(meta: Meta, test_function: fn() -> Nil)
+}
+
+pub type MetaShould(t) {
+ MetaShould(equal: fn(t, t) -> Nil, not_equal: fn(t, t) -> Nil)
+}
+
+pub fn test(meta: Meta, test_function: fn(Meta) -> Nil) {
+ Test(meta, fn() { test_function(meta) })
+}
+
+pub fn with_meta(meta: Meta, test_function: fn(MetaShould(a)) -> Nil) {
+ Test(
+ meta,
+ fn() {
+ test_function(MetaShould(
+ fn(a, b) { equal(a, b, meta) },
+ fn(a, b) { not_equal(a, b, meta) },
+ ))
+ },
+ )
+}
+
+pub fn equal(a: t, b: t, meta: Meta) {
+ io.debug(a)
+ io.debug(b)
+ should.equal_meta(a, b, meta)
+}
+
+pub fn not_equal(a: t, b: t, meta: Meta) {
+ should.equal_meta(a, b, meta)
+}
+
+pub fn be_ok(a: Result(o, e), meta: Meta) {
+ should.be_ok_meta(a, meta)
+}
+
+pub fn be_error(a: Result(o, e), meta: Meta) {
+ should.be_error_meta(a, meta)
+}
+
+pub fn fail(meta: Meta) {
+ should.fail_meta(meta)
+}
+
+pub fn be_true(a: Bool, meta: Meta) {
+ should.be_true_meta(a, meta)
+}
+
+pub fn be_false(a: Bool, meta: Meta) {
+ should.be_false_meta(a, meta)
+}