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.7 tracks/perl6/exercises/grains/grains.t
trackler-2.0.8.6 tracks/perl6/exercises/grains/grains.t
trackler-2.0.8.5 tracks/perl6/exercises/grains/grains.t
trackler-2.0.8.4 tracks/perl6/exercises/grains/grains.t
trackler-2.0.8.3 tracks/perl6/exercises/grains/grains.t
trackler-2.0.8.2 tracks/perl6/exercises/grains/grains.t
trackler-2.0.8.1 tracks/perl6/exercises/grains/grains.t
trackler-2.0.7.0 tracks/perl6/exercises/grains/grains.t
trackler-2.0.6.44 tracks/perl6/exercises/grains/grains.t
trackler-2.0.6.43 tracks/perl6/exercises/grains/grains.t
trackler-2.0.6.42 tracks/perl6/exercises/grains/grains.t
trackler-2.0.6.41 tracks/perl6/exercises/grains/grains.t
trackler-2.0.6.40 tracks/perl6/exercises/grains/grains.t
trackler-2.0.6.39 tracks/perl6/exercises/grains/grains.t
trackler-2.0.6.38 tracks/perl6/exercises/grains/grains.t
trackler-2.0.6.37 tracks/perl6/exercises/grains/grains.t
trackler-2.0.6.36 tracks/perl6/exercises/grains/grains.t
trackler-2.0.6.35 tracks/perl6/exercises/grains/grains.t
trackler-2.0.6.34 tracks/perl6/exercises/grains/grains.t
trackler-2.0.6.33 tracks/perl6/exercises/grains/grains.t