summaryrefslogtreecommitdiff
path: root/i-was-told-there-would-be-no-math/iwttwbnm-test.scm
diff options
context:
space:
mode:
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.scm57
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")