Sha256: e975bf765fe94638ee5c9b3616ba34b7ec6809bc8a6ecd5c04388736cd35d21a

Contents?: true

Size: 697 Bytes

Versions: 75

Compression:

Stored size: 697 Bytes

Contents

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

plan 11;
my $module = %*ENV<EXERCISM> ?? 'Example' !! 'Grains';
use-ok $module;
require ::($module) <Grains>;

ok Grains.can('square'), 'Grains class has square method';
ok Grains.can('total'), 'Grains class has total method';

is Grains.square(1),  1, 'test square 1';
is Grains.square(2),  2, 'test square 2';
is Grains.square(3),  4, 'test square 3';
is Grains.square(4),  8,  'test square 4';
is Grains.square(16), 32768, 'test square 16';
is Grains.square(32), 2147483648, 'test square 32';
is Grains.square(64), 9223372036854775808, 'test square 64';
is Grains.total,      18446744073709551615, 'test total';

Version data entries

75 entries across 75 versions & 1 rubygems

Version Path
trackler-2.0.6.32 tracks/perl6/exercises/grains/grains.t
trackler-2.0.6.31 tracks/perl6/exercises/grains/grains.t
trackler-2.0.6.30 tracks/perl6/exercises/grains/grains.t
trackler-2.0.6.29 tracks/perl6/exercises/grains/grains.t
trackler-2.0.6.28 tracks/perl6/exercises/grains/grains.t
trackler-2.0.6.27 tracks/perl6/exercises/grains/grains.t
trackler-2.0.6.26 tracks/perl6/exercises/grains/grains.t
trackler-2.0.6.25 tracks/perl6/exercises/grains/grains.t
trackler-2.0.6.24 tracks/perl6/exercises/grains/grains.t
trackler-2.0.6.23 tracks/perl6/exercises/grains/grains.t
trackler-2.0.6.22 tracks/perl6/exercises/grains/grains.t
trackler-2.0.6.21 tracks/perl6/exercises/grains/grains.t
trackler-2.0.6.20 tracks/perl6/exercises/grains/grains.t
trackler-2.0.6.19 tracks/perl6/exercises/grains/grains.t
trackler-2.0.6.18 tracks/perl6/exercises/grains/grains.t
trackler-2.0.6.17 tracks/perl6/exercises/grains/grains.t
trackler-2.0.6.16 tracks/perl6/exercises/grains/grains.t
trackler-2.0.6.15 tracks/perl6/exercises/grains/grains.t
trackler-2.0.6.14 tracks/perl6/exercises/grains/grains.t
trackler-2.0.6.13 tracks/perl6/exercises/grains/grains.t