Sha256: 234b1a820ab435b1ab84094e1288a0b15a48e846a6df5b55498629d867c0aa38

Contents?: true

Size: 392 Bytes

Versions: 114

Compression:

Stored size: 392 Bytes

Contents

exercise: PhoneNumber
version: 2
plan: 15
subs: clean_number
tests: |-
  foreach my $subcases (@{$C_DATA->{cases}}) {
    is $subs{clean_number}->($_->{phrase}), $_->{expected}, $_->{description} foreach @{$subcases->{cases}};
  }

example: |
  sub clean_number {
    my ($number) = @_;
    $number =~ s/\D//g;
    return $number =~ /^ 1? ( (?: [2-9] \d{2} ){2} \d{4} ) $/x ? $1 : undef;
  }

Version data entries

114 entries across 114 versions & 1 rubygems

Version Path
trackler-2.2.1.50 tracks/perl5/exercises/phone-number/example.yaml
trackler-2.2.1.49 tracks/perl5/exercises/phone-number/example.yaml
trackler-2.2.1.48 tracks/perl5/exercises/phone-number/example.yaml
trackler-2.2.1.47 tracks/perl5/exercises/phone-number/example.yaml
trackler-2.2.1.46 tracks/perl5/exercises/phone-number/example.yaml
trackler-2.2.1.45 tracks/perl5/exercises/phone-number/example.yaml
trackler-2.2.1.44 tracks/perl5/exercises/phone-number/example.yaml
trackler-2.2.1.43 tracks/perl5/exercises/phone-number/example.yaml
trackler-2.2.1.42 tracks/perl5/exercises/phone-number/example.yaml
trackler-2.2.1.41 tracks/perl5/exercises/phone-number/example.yaml
trackler-2.2.1.40 tracks/perl5/exercises/phone-number/example.yaml
trackler-2.2.1.39 tracks/perl5/exercises/phone-number/example.yaml
trackler-2.2.1.38 tracks/perl5/exercises/phone-number/example.yaml
trackler-2.2.1.37 tracks/perl5/exercises/phone-number/example.yaml
trackler-2.2.1.36 tracks/perl5/exercises/phone-number/example.yaml
trackler-2.2.1.35 tracks/perl5/exercises/phone-number/example.yaml
trackler-2.2.1.34 tracks/perl5/exercises/phone-number/example.yaml
trackler-2.2.1.33 tracks/perl5/exercises/phone-number/example.yaml
trackler-2.2.1.32 tracks/perl5/exercises/phone-number/example.yaml
trackler-2.2.1.31 tracks/perl5/exercises/phone-number/example.yaml