Sha256: a7c618ac5c5fd45fd3849676a0cbedb4051d26854d3e8fc7f95963e8f876baff

Contents?: true

Size: 575 Bytes

Versions: 8

Compression:

Stored size: 575 Bytes

Contents

#!/usr/bin/env perl6
use v6;
use Test;
use lib IO::Path.new($?FILE).parent.path;

plan 8;

BEGIN {
    my $module = %*ENV{'EXERCISM'} ?? 'Example' !! 'Leap';
    EVAL("use $module");
};

pass 'Load module';

ok Leap.can('is_leap'), 'Leap class has is_leap() method';

ok my $leap = Leap.new, 'Create new Leap object';

my %year = (
    1996 => True,
    1997 => False,
    1998 => False,
    1900 => False,
    2400 => True,
);

for %year.sort -> $y {
    is $leap.is_leap($y.key), $y.value, 
        [ flat( $y.key, 'is', 'not' xx !$y.value, 'a leap year' ) ].join( ' ' )
}

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
trackler-2.0.3.2 tracks/perl6/exercises/leap/leap.t
trackler-2.0.3.1 tracks/perl6/exercises/leap/leap.t
trackler-2.0.3.0 tracks/perl6/exercises/leap/leap.t
trackler-2.0.2.0 tracks/perl6/exercises/leap/leap.t
trackler-2.0.1.2 tracks/perl6/exercises/leap/leap.t
trackler-2.0.1.1 tracks/perl6/exercises/leap/leap.t
trackler-2.0.1.0 tracks/perl6/exercises/leap/leap.t
trackler-2.0.0.10 tracks/perl6/exercises/leap/leap.t