tracks/perl6/exercises/grains/example.yaml in trackler-2.2.1.53 vs tracks/perl6/exercises/grains/example.yaml in trackler-2.2.1.54
- old
+ new
@@ -1,25 +1,25 @@
exercise: Grains
version: 1
plan: 13
imports: '&grains-on-square &total-grains'
-tests: |
+tests: |-
for @($c-data<cases>[0]<cases>) {
if .<expected> == -1 {
throws-like { grains-on-square(.<input>) }, Exception, .<description>;
} else {
is grains-on-square(.<input>), |.<expected description>;
}
}
is total-grains, |$c-data<cases>[1]<expected description>;
unit: module
-example: |
+example: |-
sub grains-on-square ($number) is export {
die if $number < 1 or $number > 64;
2**($number-1);
}
-
+
sub total-grains is export {
my Int $total;
for 1..64 { $total += grains-on-square($_) }
$total;
}