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
CommitLineData
543eec9e
JP
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
7use Test::More qw/no_plan/;
8
9BEGIN {
10 (my $coretests = $0) =~ s'[^/]+\.t'coretests.pm';
11 require $coretests;
12 use_ok('version', 0.96);
13}
14
15diag "Tests with base class" unless $ENV{PERL_CORE};
16
17BaseTests("version","new","qv");
18BaseTests("version","new","declare");
19BaseTests("version","parse", "qv");
20BaseTests("version","parse", "declare");
21
22# dummy up a redundant call to satify David Wheeler
23local $SIG{__WARN__} = sub { die $_[0] };
24eval 'use version;';
25unlike ($@, 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
29my $v = eval {
30 require IO::Handle;
31 $@ = qq(Can't locate some/completely/fictitious/module.pm);
32 return IO::Handle->VERSION;
33};
34ok defined($v), 'Fix for RT #47980';