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.8.28 tracks/perl6/exercises/grains/grains.t
trackler-2.0.8.27 tracks/perl6/exercises/grains/grains.t
trackler-2.0.8.26 tracks/perl6/exercises/grains/grains.t
trackler-2.0.8.24 tracks/perl6/exercises/grains/grains.t
trackler-2.0.8.23 tracks/perl6/exercises/grains/grains.t
trackler-2.0.8.22 tracks/perl6/exercises/grains/grains.t
trackler-2.0.8.21 tracks/perl6/exercises/grains/grains.t
trackler-2.0.8.20 tracks/perl6/exercises/grains/grains.t
trackler-2.0.8.19 tracks/perl6/exercises/grains/grains.t
trackler-2.0.8.18 tracks/perl6/exercises/grains/grains.t
trackler-2.0.8.17 tracks/perl6/exercises/grains/grains.t
trackler-2.0.8.16 tracks/perl6/exercises/grains/grains.t
trackler-2.0.8.15 tracks/perl6/exercises/grains/grains.t
trackler-2.0.8.14 tracks/perl6/exercises/grains/grains.t
trackler-2.0.8.13 tracks/perl6/exercises/grains/grains.t
trackler-2.0.8.12 tracks/perl6/exercises/grains/grains.t
trackler-2.0.8.11 tracks/perl6/exercises/grains/grains.t
trackler-2.0.8.10 tracks/perl6/exercises/grains/grains.t
trackler-2.0.8.9 tracks/perl6/exercises/grains/grains.t
trackler-2.0.8.8 tracks/perl6/exercises/grains/grains.t