Skip to content

Commit

Permalink
dynamically created lists can be used to define an enum
Browse files Browse the repository at this point in the history
  • Loading branch information
zoffixznet committed Sep 10, 2016
1 parent 3f98103 commit 0cfcd4f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion S12-enums/basic.t
@@ -1,6 +1,6 @@
use v6;
use Test;
plan 38;
plan 39;

# Very basic enum tests

Expand Down Expand Up @@ -134,4 +134,13 @@ dies-ok({ my Color $c3 = "for the fail" }, 'enum as a type enforces checks');
isa-ok Foo.enums, Map, '.enums returns a Map';
}

# RT #124251
subtest 'dynamically created lists can be used to define an enum' => {
plan 2;
my enum rt124251 ('a'..'c' X~ 1 .. 2);
cmp-ok b2, '==', 3, 'enum element has correct value';
is-deeply rt124251.enums, Map.new( (:0a1,:1a2,:2b1,:3b2,:4c1,:5c2) ),
'.enums are all correct';
}

# vim: ft=perl6

0 comments on commit 0cfcd4f

Please sign in to comment.