File: inc_filter.t

package info (click to toggle)
libdevel-cover-perl 1.51-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,036 kB
  • sloc: perl: 10,861; sh: 687; makefile: 7
file content (30 lines) | stat: -rw-r--r-- 675 bytes parent folder | download | duplicates (7)
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
use strict;
use warnings;

package test_inc_filter;

use Test::More;
use Cwd 'abs_path';
use File::Spec;
use Devel::Cover::Util 'remove_contained_paths';

plan tests => 2;

run();

sub run {
    my $cwd = abs_path "t/internal/inc_filter/cwd";

    my @inc_tests = qw( cwd cwd/lib cwd_lib );
    my @inc = map "t/internal/inc_filter/$_", @inc_tests;
    @inc = map { abs_path( $_ ), File::Spec->rel2abs( $_ ) } @inc;
    @inc = map { $_, lcfirst $_ } @inc;

    @inc = remove_contained_paths( $cwd, @inc );

    is ~~ ( grep { /cwd_lib/ } @inc ), 4,
       "cwd_lib was left in the array four times";
    is ~~ @inc, 4, "no other paths were left in the array";

    return;
}