This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Merge CPAN version.pm tests into CORE.
[perl5.git] / lib / version / t / 01base.t
1 #! /usr/local/perl -w
2 # Before `make install' is performed this script should be runnable with
3 # `make test'. After `make install' it should work as `perl test.pl'
4
5 #########################
6
7 use Test::More qw/no_plan/;
8
9 BEGIN {
10     (my $coretests = $0) =~ s'[^/]+\.t'coretests.pm';
11     require $coretests;
12     use_ok('version', 0.96);
13 }
14
15 diag "Tests with base class" unless $ENV{PERL_CORE};
16
17 BaseTests("version","new","qv");
18 BaseTests("version","new","declare");
19 BaseTests("version","parse", "qv");
20 BaseTests("version","parse", "declare");
21
22 # dummy up a redundant call to satify David Wheeler
23 local $SIG{__WARN__} = sub { die $_[0] };
24 eval 'use version;';
25 unlike ($@, qr/^Subroutine main::declare redefined/,
26     "Only export declare once per package (to prevent redefined warnings).");
27
28 # https://rt.cpan.org/Ticket/Display.html?id=47980
29 my $v = eval {
30     require IO::Handle;
31     $@ = qq(Can't locate some/completely/fictitious/module.pm);
32     return IO::Handle->VERSION;
33 };
34 ok defined($v), 'Fix for RT #47980';