summaryrefslogtreecommitdiff
path: root/prime?/prime-test.scm
blob: 3add85aee3c0981d35d35af2f984dcf2ce06fb28 (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
;; -*- compile-command: "guile -L . prime-test.scm"; -*-
(use-modules (srfi srfi-64)
             (prime))

(test-begin "harness")


(test-assert "test-not-prime-0"
  (not (prime? 12)))

(test-assert "test-not-prime-1"
  (not (prime? 21)))

(test-assert "test-prime"
  (prime? 13))

(test-assert "test-prime-large"
  (prime? 1000033))

(test-assert "test-two"
  (prime? 2))

;; one is NOT considered prime!
(test-assert "test-one"
  (not (prime? 1)))

;; zero is NOT considered prime!
(test-assert "test-zero"
  (not (prime? 0)))

(test-assert "test-negative"
  (not (prime? -13)))


(test-end "harness")