1 USING: arrays kernel math roman roman.private sequences tools.test ;
3 [ "i" ] [ 1 >roman ] unit-test
4 [ "ii" ] [ 2 >roman ] unit-test
5 [ "iii" ] [ 3 >roman ] unit-test
6 [ "iv" ] [ 4 >roman ] unit-test
7 [ "v" ] [ 5 >roman ] unit-test
8 [ "vi" ] [ 6 >roman ] unit-test
9 [ "vii" ] [ 7 >roman ] unit-test
10 [ "viii" ] [ 8 >roman ] unit-test
11 [ "ix" ] [ 9 >roman ] unit-test
12 [ "x" ] [ 10 >roman ] unit-test
13 [ "mdclxvi" ] [ 1666 >roman ] unit-test
14 [ "mmmcdxliv" ] [ 3444 >roman ] unit-test
15 [ "mmmcmxcix" ] [ 3999 >roman ] unit-test
16 [ "MMMCMXCIX" ] [ 3999 >ROMAN ] unit-test
17 [ 3999 ] [ 3999 >ROMAN roman> ] unit-test
18 [ 1 ] [ 1 >roman roman> ] unit-test
19 [ 2 ] [ 2 >roman roman> ] unit-test
20 [ 3 ] [ 3 >roman roman> ] unit-test
21 [ 4 ] [ 4 >roman roman> ] unit-test
22 [ 5 ] [ 5 >roman roman> ] unit-test
23 [ 6 ] [ 6 >roman roman> ] unit-test
24 [ 7 ] [ 7 >roman roman> ] unit-test
25 [ 8 ] [ 8 >roman roman> ] unit-test
26 [ 9 ] [ 9 >roman roman> ] unit-test
27 [ 10 ] [ 10 >roman roman> ] unit-test
28 [ 1666 ] [ 1666 >roman roman> ] unit-test
29 [ 3444 ] [ 3444 >roman roman> ] unit-test
30 [ 3999 ] [ 3999 >roman roman> ] unit-test
31 [ 0 >roman ] must-fail
32 [ 4000 >roman ] must-fail
33 [ "vi" ] [ "iii" "iii" roman+ ] unit-test
34 [ "viii" ] [ "x" "ii" roman- ] unit-test
35 [ "ix" ] [ "iii" "iii" roman* ] unit-test
36 [ "i" ] [ "iii" "ii" roman/i ] unit-test
37 [ "i" "ii" ] [ "v" "iii" roman/mod ] unit-test
38 [ "iii" "iii" roman- ] must-fail
40 [ 30 ] [ ROMAN: xxx ] unit-test