File: 01-basics.t

package info (click to toggle)
libalt-base-perl 0.2-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 160 kB
  • sloc: perl: 173; makefile: 2
file content (33 lines) | stat: -rw-r--r-- 605 bytes parent folder | download | duplicates (4)
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
#!perl

use strict;
use warnings;
use FindBin '$Bin';
use lib "$Bin/lib";

use Module::Load;
use Test::Exception;
use Test::More 0.98;

sub use_ {
    my $mod = shift;
    load $mod;
    if (@_) {
        $mod->import(@_);
    } else {
        $mod->import;
    }
}

sub no_ {
    my $mod = shift;
    $mod->unimport;
}

lives_ok { use_ "Alt::Foo::one" };
dies_ok  { use_ "Alt::Foo"      } "check incorrect Alt name";
dies_ok  { use_ "Alt::Bar::one" } "check \$ALT defined";
lives_ok { use_ "Alt::Bar::two" } "turn check off";
dies_ok  { use_ "Alt::Baz::one" } "check correct \$ALT value";

done_testing;