Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: fa50707da1
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 21 lines (15 sloc) 0.678 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
use v6;
use Test;
plan 7;

# Tests for anonymous enumerations.

# L<S12/Anonymous Enumerations/An anonymous enum just makes sure each string turns into a pair>

my $e = enum < ook! ook. ook? >;
is $e.keys.elems, 3, 'anonymous enum created correct sized hash';
is $e<ook!>, 0, 'anonymous enum created correctly';
is $e<ook.>, 1, 'anonymous enum created correctly';
is $e<ook?>, 2, 'anonymous enum created correctly';
isa_ok $e, EnumMap, 'anonymous enum returns an EnumMap';

my %e1 = enum <foo>;
is %e1.keys.elems, 1, 'single-value anonymous enum created correct sized hash';
is %e1<foo>, 0, 'single-value anonymous enum created correctly';

# vim: ft=perl6
Something went wrong with that request. Please try again.