-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathroman-test.ss
More file actions
executable file
·32 lines (22 loc) · 909 Bytes
/
roman-test.ss
File metadata and controls
executable file
·32 lines (22 loc) · 909 Bytes
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
(load "common.ss")
(load "roman.ss")
(load "scheme-test.ss")
(displayln " === Romans Tests === ");
(repeat 2015 (lambda(x) (show x (numeric->roman x))))
(test "Roman dictionary is properly loaded"
roman-dict
equal?
(list "*dict*" '(1000 "M") '(900 "CM") '(500 "D") '(400 "CD") '(100 "C") '(90 "XC") '(50 "L") '(40 "XL") '(10 "X") '(9 "IX") '(5 "V") '(4 "IV") '(1 "I")))
(test "Roman numbers are properly loaded"
(dict-get-keys-from roman-dict)
equal?
'(1000 900 500 400 100 90 50 40 10 9 5 4 1))
(test "Roman symbols are properly loaded"
(dict-get-values-from roman-dict)
equal?
'("M" "CM" "D" "CD" "C" "XC" "L" "XL" "X" "IX" "V" "IV" "I"))
(test "2010 results into MMX"
(numeric->roman 2010) equal? "MMX")
(test "2009 results into MMIX"
(numeric->roman 2009) equal? "MMIX")
(displayln "");