File: 02.format_perl_version.t

package info (click to toggle)
perlbrew 0.78-1%2Bdeb9u1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 708 kB
  • sloc: perl: 6,291; makefile: 6
file content (38 lines) | stat: -rw-r--r-- 715 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env perl
use strict;
use warnings;
use English qw( -no_match_vars );
use Test::More;
use lib qw(lib);

use App::perlbrew;
use Test::NoWarnings;

my @test_cases = (
    {
        raw    => q{5.008008},
        parsed => q{5.8.8},
    },
    {
        raw    => q{5.010001},
        parsed => q{5.10.1},
    },
    {
        raw    => q{5.012002},
        parsed => q{5.12.2},
    },
    {
        raw    => q{5.008},
        parsed => q{5.8.0},
    },
);

plan tests => scalar @test_cases + 1;
{
    my $app = App::perlbrew->new();
 TEST:
    foreach my $test (@test_cases) {
        is( $app->format_perl_version( $test->{raw} ),
            $test->{parsed}, "$test->{raw} -> $test->{parsed}" );
    }
}