]> ruin.nu Git - ndwebbie.git/blob - t/stats.t
Stat updates for r100
[ndwebbie.git] / t / stats.t
1 use strict;
2 use warnings;
3 use Test2::V0;
4
5 use Data::Dumper;
6 use FindBin;
7
8 use NDWeb::Stats;
9
10 my $xml = do {
11         open my $in, '<', "$FindBin::Bin/stats.xml" or die "Can't read file: $!";
12         local $/;
13         <$in>
14 };
15 my @ships = parseStats($xml);
16
17 #print Dumper(\@ships), "\n";
18
19 is ($ships[0]->{ship}, 'Harpy');
20 is ($ships[0]->{race}, 'Terran');
21 is ($ships[0]->{class}, 'Fi');
22 is ($ships[0]->{type}, 'Normal');
23 is ($ships[0]->{baseeta}, 12);
24 is ($ships[0]->{init}, 11);
25 is ($ships[0]->{damage}, 14);
26 is ($ships[8]->{class}, 'Fr');
27 is ($ships[8]->{type}, 'Pod');
28 is ($ships[8]->{t1}, 'Ro');
29 is ($ships[8]->{cloaked}, 0);
30 is ($ships[11]->{class}, 'De');
31 is ($ships[11]->{type}, 'Structure');
32 is ($ships[11]->{t1}, 'St');
33 is ($ships[16]->{ship}, 'Black Widow');
34 is ($ships[16]->{race}, 'Cathaar');
35 is ($ships[16]->{class}, 'De');
36 is ($ships[16]->{type}, 'EMP');
37 is ($ships[16]->{t1}, 'Cr');
38 is ($ships[16]->{t2}, '-');
39 is ($ships[16]->{baseeta}, 13);
40 is ($ships[16]->{init}, 2);
41 is ($ships[16]->{cloaked}, 0);
42 is ($ships[16]->{damage}, 0);
43 is ($ships[15]->{t2}, 'Bs');
44 is ($ships[22]->{class}, 'Cr');
45 is ($ships[22]->{type}, 'Pod');
46 is ($ships[22]->{t1}, 'Ro');
47 is ($ships[55]->{ship}, 'Gas giant');
48 is ($ships[55]->{race}, 'Kinthia');
49 is ($ships[55]->{class}, 'Bs');
50 is ($ships[55]->{type}, 'EMP');
51 is ($ships[55]->{t1}, 'Cr');
52 is ($ships[55]->{t2}, '-');
53 is ($ships[55]->{baseeta}, 14);
54 is ($ships[55]->{init}, 1);
55 is ($ships[55]->{cloaked}, 1);
56 is ($ships[55]->{damage}, 0);
57 is ($ships[69]->{ship}, 'Ram');
58 is ($ships[69]->{race}, 'Slythonian');
59 is ($ships[69]->{class}, 'Co');
60 is ($ships[69]->{type}, 'Resources');
61 is ($ships[69]->{t1}, 'Re');
62 is ($ships[69]->{t2}, '-');
63 is ($ships[69]->{baseeta}, 12);
64 is ($ships[69]->{init}, 40);
65
66 done_testing();