Skip to content

Commit

Permalink
[coverage] Cover all routines in Enumeration.pm
Browse files Browse the repository at this point in the history
  • Loading branch information
zoffixznet committed Oct 3, 2016
1 parent 5aa5497 commit feb0661
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion S12-enums/basic.t
@@ -1,6 +1,6 @@
use v6;
use Test;
plan 39;
plan 42;

# Very basic enum tests

Expand Down Expand Up @@ -143,4 +143,23 @@ subtest 'dynamically created lists can be used to define an enum' => {
'.enums are all correct';
}

{ # coverage; 2016-10-03
my enum Cover20161003 <foo-cover bar-cover>;
subtest 'Enumeration:D.kv' => {
plan 2;
is-deeply foo-cover.kv, ('foo-cover', 0), 'first element';
is-deeply bar-cover.kv, ('bar-cover', 1), 'second element';
}
subtest 'Enumeration:D.pair' => {
plan 2;
is-deeply foo-cover.pair, (foo-cover => 0), 'first element';
is-deeply bar-cover.pair, (bar-cover => 1), 'second element';
}
subtest 'Enumeration:D.Int' => {
plan 2;
is-deeply foo-cover.Int, 0, 'first element';
is-deeply bar-cover.Int, 1, 'second element';
}
}

# vim: ft=perl6

0 comments on commit feb0661

Please sign in to comment.