summaryrefslogtreecommitdiff
path: root/lib/version/t/01base.t
blob: c84531d0c50660236982c3c162a85f2b2116cb3b (plain)
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
#! /usr/local/perl -w
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl test.pl'

#########################

use Test::More qw/no_plan/;

BEGIN {
    (my $coretests = $0) =~ s'[^/]+\.t'coretests.pm';
    require $coretests;
    use_ok('version', 0.9901);
}

diag "Tests with base class" unless $ENV{PERL_CORE};

BaseTests("version","new","qv");
BaseTests("version","new","declare");
BaseTests("version","parse", "qv");
BaseTests("version","parse", "declare");

# dummy up a redundant call to satify David Wheeler
local $SIG{__WARN__} = sub { die $_[0] };
eval 'use version;';
unlike ($@, qr/^Subroutine main::declare redefined/,
    "Only export declare once per package (to prevent redefined warnings).");

# https://rt.cpan.org/Ticket/Display.html?id=47980
my $v = eval {
    require IO::Handle;
    $@ = qq(Can't locate some/completely/fictitious/module.pm);
    return IO::Handle->VERSION;
};
ok defined($v), 'Fix for RT #47980';