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.70 tracks/perl5/exercises/phone-number/example.yaml
trackler-2.2.1.69 tracks/perl5/exercises/phone-number/example.yaml
trackler-2.2.1.68 tracks/perl5/exercises/phone-number/example.yaml
trackler-2.2.1.67 tracks/perl5/exercises/phone-number/example.yaml
trackler-2.2.1.66 tracks/perl5/exercises/phone-number/example.yaml
trackler-2.2.1.65 tracks/perl5/exercises/phone-number/example.yaml
trackler-2.2.1.64 tracks/perl5/exercises/phone-number/example.yaml
trackler-2.2.1.63 tracks/perl5/exercises/phone-number/example.yaml
trackler-2.2.1.62 tracks/perl5/exercises/phone-number/example.yaml
trackler-2.2.1.61 tracks/perl5/exercises/phone-number/example.yaml
trackler-2.2.1.60 tracks/perl5/exercises/phone-number/example.yaml
trackler-2.2.1.59 tracks/perl5/exercises/phone-number/example.yaml
trackler-2.2.1.58 tracks/perl5/exercises/phone-number/example.yaml
trackler-2.2.1.57 tracks/perl5/exercises/phone-number/example.yaml
trackler-2.2.1.56 tracks/perl5/exercises/phone-number/example.yaml
trackler-2.2.1.55 tracks/perl5/exercises/phone-number/example.yaml
trackler-2.2.1.54 tracks/perl5/exercises/phone-number/example.yaml
trackler-2.2.1.53 tracks/perl5/exercises/phone-number/example.yaml
trackler-2.2.1.52 tracks/perl5/exercises/phone-number/example.yaml
trackler-2.2.1.51 tracks/perl5/exercises/phone-number/example.yaml