File: crash.t

package info (click to toggle)
libstrictures-perl 2.000006-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 164 kB
  • sloc: perl: 340; makefile: 5
file content (29 lines) | stat: -rw-r--r-- 641 bytes parent folder | download | duplicates (2)
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
use strict;
use warnings FATAL => 'all';
use Test::More
  "$]" < 5.008004 ? ( skip_all => "can't test extra loading on perl < 5.8.4" )
                : ( tests => 1 );
use File::Spec;

my %extras = map { my $m = "$_.pm"; $m =~ s{::}{/}g; $m => 1 } qw(
  indirect
  multidimensional
  bareword::filehandles
);

unshift @INC, sub {
  my $mod = $_[1];
  die "Can't locate $mod in \@INC\n"
    if $extras{$mod};
  return 0;
};

my $err = do {
  local $ENV{PERL_STRICTURES_EXTRA} = 1;
  local *STDERR;
  open STDERR, '>', File::Spec->devnull;
  eval q{use strictures;};
  $@;
};

is $err, '', 'can manage to survive with some modules missing!';