summaryrefslogtreecommitdiff
path: root/number-spiral-diagonals/nsd-test.scm
blob: bcad616b669740bf9fa00a098c2186be6a4b10c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
;; -*- compile-command: "guile -L . nsd-test.scm"; -*-
(use-modules (srfi srfi-64)
             (nsd))


(test-begin "harness")


(test-equal "calculate-seq-length 1x1"
  1
  (calculate-seq-length 1))

(test-equal "calculate-seq-length 3x3"
  5
  (calculate-seq-length 3))

(test-equal "calculate-seq-length 5x5"
  9
  (calculate-seq-length 5))

(test-equal "nsd-generator size 1"
  '(1)
  (nsd-generator 1))

(test-equal "nsd-generator size 2"
  '(1 3)
  (nsd-generator 2))

(test-equal "nsd-generator max two inc"
  '(1 3 5 7 9)
  (nsd-generator 5))

(test-equal "nsd-generator four inc"
  '(1 3 5 7 9 13)
  (nsd-generator 6))

(test-equal "nsd-generator six inc"
  '(1 3 5 7 9 13 17 21 25 31)
  (nsd-generator 10))

(test-equal "nsd-generator eight inc"
  '(1 3 5 7 9 13 17 21 25 31 37 43 49 57)
  (nsd-generator 14))

(test-equal "nsd add 1x1"
  1
  (nsd 1))

(test-equal "nsd add 3x3"
  25
  (nsd 3))

(test-equal "nsd add 7x7"
  261
  (nsd 7))


(test-end "harness")