From e29188413ec6c3243f7965b4408459a7517539b3 Mon Sep 17 00:00:00 2001 From: bd Date: Sun, 9 Jun 2024 23:09:57 -0600 Subject: AoC 2015.2 p1+2 --- .../iwttwbnm-test.scm | 57 ++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 i-was-told-there-would-be-no-math/iwttwbnm-test.scm (limited to 'i-was-told-there-would-be-no-math/iwttwbnm-test.scm') diff --git a/i-was-told-there-would-be-no-math/iwttwbnm-test.scm b/i-was-told-there-would-be-no-math/iwttwbnm-test.scm new file mode 100644 index 0000000..94564dd --- /dev/null +++ b/i-was-told-there-would-be-no-math/iwttwbnm-test.scm @@ -0,0 +1,57 @@ +;; -*- compile-command: "guile -L . iwttwbnm-test.scm"; -*- +(use-modules (srfi srfi-64) + (iwttwbnm)) + +(test-begin "harness") + +(test-equal "zero-dimensional-box" + 0 + (calculate-box 0 0 0)) + +(test-equal "2 3 4 dimensional-box" + 58 + (calculate-box 2 3 4)) + +(test-equal "1 1 10 dimensional-box" + 43 + (calculate-box 1 1 10)) + +(test-equal "3 6 9 dimensional-box" + 216 + (calculate-box 3 6 9)) + +;; removed by part 2 +;; (test-equal "Process all inputs" +;; 317 +;; (iwttwbnm " +;; 0x0x0 +;; 2x3x4 +;; 1x1x10 +;; 3x6x9")) + +(test-equal "0 0 0 dimensional-box" + 0 + (calculate-ribbon 0 0 0)) + +(test-equal "2 3 4 dimensional-box" + 34 + (calculate-ribbon 2 3 4)) + +(test-equal "1 1 10 dimensional-box" + 14 + (calculate-ribbon 1 1 10)) + +(test-equal "2 3 4 dimensional-box" + 180 + (calculate-ribbon 3 6 9)) + +(test-equal "Process all inputs" + '(317 228) + (iwttwbnm " +0x0x0 +2x3x4 +1x1x10 +3x6x9")) + + +(test-end "harness") -- cgit v1.2.3