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'
5 #########################
7 use Test::More qw/no_plan/;
11 my $coretests = File::Spec->rel2abs(
13 (File::Spec->splitpath($0))[0,1], 'coretests.pm'
17 use_ok('version', 0.9921);
20 BaseTests("version","new","qv");
21 BaseTests("version","new","declare");
22 BaseTests("version","parse", "qv");
23 BaseTests("version","parse", "declare");
25 # dummy up a redundant call to satify David Wheeler
26 local $SIG{__WARN__} = sub { die $_[0] };
28 unlike ($@, qr/^Subroutine main::declare redefined/,
29 "Only export declare once per package (to prevent redefined warnings).");
31 # https://rt.cpan.org/Ticket/Display.html?id=47980
34 $@ = qq(Can't locate some/completely/fictitious/module.pm);
35 return IO::Handle->VERSION;
37 ok defined($v), 'Fix for RT #47980';
39 { # https://rt.cpan.org/Ticket/Display.html?id=81085
40 eval { version::new() };
41 like $@, qr'Usage: version::new\(class, version\)',
42 'No bus err when called as function';
43 eval { $x = 1; print version::new };
44 like $@, qr'Usage: version::new\(class, version\)',
45 'No implicit object creation when called as function';
46 eval { $x = "version"; print version::new };
47 like $@, qr'Usage: version::new\(class, version\)',
48 'No implicit object creation when called as function';