Sha256: 0823dd5f3b379117edd391a8bf01da6f25c9125fe831fd6787ae53507b138aa5

Contents?: true

Size: 1.51 KB

Versions: 119

Compression:

Stored size: 1.51 KB

Contents

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

exercise_comment: '# The name of this exercise.'
module_comment: "# $ENV{EXERCISM} is for tests not directly for the exercise, don't worry about these :)"
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.'
done_testing_comment: '# There are no more tests after this :)'
cdata_test_comment: '# Ignore this for your exercise! Tells Exercism folks when exercise cases become out of date.'
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!
INIT_comment: |-
  # 'INIT' is a phaser, it makes sure that the test data is available before everything else
  # starts running (otherwise we'd have to shove the test data into the middle of the file!)

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

119 entries across 119 versions & 1 rubygems

Version Path
trackler-2.2.1.104 tracks/perl5/exercises/leap/example.yaml
trackler-2.2.1.103 tracks/perl5/exercises/leap/example.yaml
trackler-2.2.1.102 tracks/perl5/exercises/leap/example.yaml
trackler-2.2.1.101 tracks/perl5/exercises/leap/example.yaml
trackler-2.2.1.100 tracks/perl5/exercises/leap/example.yaml
trackler-2.2.1.99 tracks/perl5/exercises/leap/example.yaml
trackler-2.2.1.98 tracks/perl5/exercises/leap/example.yaml
trackler-2.2.1.97 tracks/perl5/exercises/leap/example.yaml
trackler-2.2.1.96 tracks/perl5/exercises/leap/example.yaml
trackler-2.2.1.95 tracks/perl5/exercises/leap/example.yaml
trackler-2.2.1.94 tracks/perl5/exercises/leap/example.yaml
trackler-2.2.1.93 tracks/perl5/exercises/leap/example.yaml
trackler-2.2.1.92 tracks/perl5/exercises/leap/example.yaml
trackler-2.2.1.91 tracks/perl5/exercises/leap/example.yaml
trackler-2.2.1.90 tracks/perl5/exercises/leap/example.yaml
trackler-2.2.1.89 tracks/perl5/exercises/leap/example.yaml
trackler-2.2.1.88 tracks/perl5/exercises/leap/example.yaml
trackler-2.2.1.87 tracks/perl5/exercises/leap/example.yaml
trackler-2.2.1.86 tracks/perl5/exercises/leap/example.yaml
trackler-2.2.1.85 tracks/perl5/exercises/leap/example.yaml