File: setup-broken.t

package info (click to toggle)
libapp-cmd-perl 0.338-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 516 kB
  • sloc: perl: 1,727; makefile: 2
file content (34 lines) | stat: -rw-r--r-- 808 bytes parent folder | download | duplicates (6)
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
use strict;
use warnings;

use Test::More 0.88;
use Test::Fatal;

use lib 't/lib';

ok( !exists $INC{'Test/BrokenCmd/Command.pm'},           'Broken library not tried to load yet' );
ok( !exists $INC{'Test/BrokenCmd/Command::Notthere.pm'}, 'Missing library not tried to load yet' );

isnt(
  exception {
    require Test::BrokenCmd;
  },
  undef,
  'using an obviously broken library should die'
);

{
  local $TODO = "require 'works' after failing on pre-5.10" if $] < 5.010;
  isnt(
    exception {
      require Test::BrokenCmd::Command;
    },
    undef,
    'the broken library is broken'
  );
}

ok( exists $INC{'Test/BrokenCmd/Command.pm'},            'Broken library tried to load' );
ok( !exists $INC{'Test/BrokenCmd/Command::Notthere.pm'}, 'Missing library not tried to load yet' );

done_testing;