File: test.pl

package info (click to toggle)
libtext-roman-perl 3.3-3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, sarge
  • size: 64 kB
  • ctags: 12
  • sloc: perl: 82; makefile: 59
file content (22 lines) | stat: -rw-r--r-- 493 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/perl

use Test::Simple tests => 7;

use Text::Roman qw/isroman roman2int int2roman ismilhar milhar2int/;
ok(1, 'use Text::Roman');

#	test reciprocity

$n = 3999;
$r[$_] = int2roman($_) for 1 .. $n;
ok(1, "array created");
for (1 .. $n) {
    die "$_: $r[$_] != $ar" unless ($ar = roman2int($r[$_])) == $_;
    }
ok(1, "reciprocity tested");

ok(isroman("IV"), "is roman");
ok(!isroman("IVI"), "is not roman");
ok(milhar2int("IV_VIII") == 4008, "milhar converted");

ok(1, "done");