diff options
author | bd <bdunahu@operationnull.com> | 2024-06-09 23:09:57 -0600 |
---|---|---|
committer | bd <bdunahu@operationnull.com> | 2024-06-09 23:09:57 -0600 |
commit | e29188413ec6c3243f7965b4408459a7517539b3 (patch) | |
tree | 401b7a300b7fe1df7cec5230ed503baac9d9074c /i-was-told-there-would-be-no-math/iwttwbnm-test.scm | |
parent | e61508e4764d69a4ea0073f419b89ff0a06e813e (diff) |
AoC 2015.2 p1+2
Diffstat (limited to 'i-was-told-there-would-be-no-math/iwttwbnm-test.scm')
-rw-r--r-- | i-was-told-there-would-be-no-math/iwttwbnm-test.scm | 57 |
1 files changed, 57 insertions, 0 deletions
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") |