Sha256: 7ee4ccc993e604a4d833618a0f02b5ab2e40d95999057679719b00a6e110e1bf

Contents?: true

Size: 1.03 KB

Versions: 47

Compression:

Stored size: 1.03 KB

Contents

exercise: Leap
version: 3
plan: 5
subs: is_leap
tests: |-
  is is_leap($_->{input}{year}), $_->{expected}, $_->{description} foreach @{$C_DATA->{cases}};

exercise_comment: '# The name of this exercise.'
version_comment: '# The version we will be matching against the exercise.'
lib_comment: '# Look for the module inside the same directory as this test file.'
plan_comment: '# This is how many tests we expect to run.'
use_test_comment: '# Check that the module can be use-d.'
version_test_comment: |-
  # If the exercise is updated, we want to make sure other people testing
  # your code don't think you've made a mistake if things have changed!

example: |-
  sub is_leap {
    my $year = shift;
    divisible_by($year, 400)
      or divisible_by($year, 4) and !divisible_by($year, 100)
      ? 1 : 0;
  }

  sub divisible_by {
    $_[0] % $_[1] == 0 ? 1 : 0;
  }

stub: |-
  sub is_leap {
    my ($year) = @_;
    # Remove the comments and write some code here to pass the test suite.
  }

package_comment: "# Declare package 'Leap' with version"

Version data entries

47 entries across 47 versions & 1 rubygems

Version Path
trackler-2.2.1.158 tracks/perl5/exercises/leap/.meta/exercise-data.yaml
trackler-2.2.1.157 tracks/perl5/exercises/leap/.meta/exercise-data.yaml
trackler-2.2.1.156 tracks/perl5/exercises/leap/.meta/exercise-data.yaml
trackler-2.2.1.155 tracks/perl5/exercises/leap/.meta/exercise-data.yaml
trackler-2.2.1.154 tracks/perl5/exercises/leap/.meta/exercise-data.yaml
trackler-2.2.1.153 tracks/perl5/exercises/leap/.meta/exercise-data.yaml
trackler-2.2.1.152 tracks/perl5/exercises/leap/.meta/exercise-data.yaml
trackler-2.2.1.151 tracks/perl5/exercises/leap/.meta/exercise-data.yaml
trackler-2.2.1.150 tracks/perl5/exercises/leap/.meta/exercise-data.yaml
trackler-2.2.1.149 tracks/perl5/exercises/leap/.meta/exercise-data.yaml
trackler-2.2.1.148 tracks/perl5/exercises/leap/.meta/exercise-data.yaml
trackler-2.2.1.147 tracks/perl5/exercises/leap/.meta/exercise-data.yaml
trackler-2.2.1.146 tracks/perl5/exercises/leap/.meta/exercise-data.yaml
trackler-2.2.1.145 tracks/perl5/exercises/leap/.meta/exercise-data.yaml
trackler-2.2.1.144 tracks/perl5/exercises/leap/.meta/exercise-data.yaml
trackler-2.2.1.143 tracks/perl5/exercises/leap/.meta/exercise-data.yaml
trackler-2.2.1.142 tracks/perl5/exercises/leap/.meta/exercise-data.yaml
trackler-2.2.1.141 tracks/perl5/exercises/leap/.meta/exercise-data.yaml
trackler-2.2.1.140 tracks/perl5/exercises/leap/.meta/exercise-data.yaml
trackler-2.2.1.139 tracks/perl5/exercises/leap/.meta/exercise-data.yaml