Commit 6942c7e8d2b5526cd88bfb2153211f638c509e4b
1 parent
72983394
Exists in
master
and in
2 other branches
add some tests
Showing
1 changed file
with
22 additions
and
1 deletions
Show diff stats
t/app.t
| 1 | 1 | use strict; |
| 2 | 2 | use warnings; |
| 3 | 3 | use Test::More; |
| 4 | + | |
| 4 | 5 | BEGIN { use_ok('CoprStatus') } |
| 5 | 6 | |
| 6 | -done_testing; | |
| 7 | +my $info = CoprStatus::copr_info(); | |
| 8 | +ok(ref($info), 'HASH'); | |
| 9 | +foreach my $key (keys %{$info}) { | |
| 10 | + ok(ref($info->{$key}), 'HASH'); | |
| 11 | + ok($info->{$key}->{'git_version'}); | |
| 12 | + ok($info->{$key}->{'v4_version'}); | |
| 13 | + ok($info->{$key}->{'v5_version'}); | |
| 14 | + like($info->{$key}->{'v4_version'}, qr/[[:ascii:]]+-[[:ascii:]]+/); | |
| 15 | + like($info->{$key}->{'v5_version'}, qr/[[:ascii:]]+-[[:ascii:]]+/); | |
| 16 | + like($info->{$key}->{'git_version'}, qr/[[:ascii:]]+-[[:ascii:]]+/); | |
| 17 | +} | |
| 18 | + | |
| 19 | +my $match = CoprStatus::compare_versions; | |
| 20 | +ok(ref($match), 'HASH'); | |
| 21 | +foreach my $key (keys %{$match}) { | |
| 22 | + like($match->{$key}, qr/1|0/); | |
| 23 | +} | |
| 24 | + | |
| 25 | +# TODO: test info2html() and build_html() | |
| 26 | + | |
| 27 | +done_testing(); | ... | ... |