File: carp_not.t

package info (click to toggle)
libppix-regexp-perl 0.090-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,524 kB
  • sloc: perl: 8,022; makefile: 8
file content (41 lines) | stat: -rw-r--r-- 750 bytes parent folder | download | duplicates (5)
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
39
40
41
package main;

use 5.006;

use strict;
use warnings;

use ExtUtils::Manifest qw{ maniread };
use PPIx::Regexp::Constant qw{ @CARP_NOT };
use Test::More 0.88;	# Because of done_testing();

my @modules;
foreach my $fn ( sort keys %{ maniread() } ) {
    local $_ = $fn;
    s< \A lib/ ><>smx
	or next;
    s< [.] pm \z ><>smx
	or next;
    s< / ><::>smxg;
    push @modules, $_;

    local $/ = undef;
    open my $fh, '<:encoding(utf-8)', $fn
	or do {
	fail "Unable to open $fn: $!";
	next;
    };
    my $content = <$fh>;
    close $fh;

    ok $content =~ m/ \@CARP_NOT \b /smx,
	"$_ assigns \@CARP_NOT";
}
is_deeply \@CARP_NOT, \@modules,
    'Ensure that @PPIx::Regexp::Constant::CARP_NOT is correct';

done_testing;

1;

# ex: set textwidth=72 :