diff options
author | Slaven Rezic <slaven@rezic.de> | 2008-02-29 12:29:31 +0100 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2008-02-29 12:59:55 +0000 |
commit | df029878ce10ba115451deaf98191420c0c2f438 (patch) | |
tree | 9a190f19853c3939a986c3676f8aeed51133d9d1 | |
parent | 451405367bf1d47e02fcb61d3526979949ff038f (diff) | |
download | perl-df029878ce10ba115451deaf98191420c0c2f438.tar.gz |
More diagnostics for Fatal.pm
Message-ID: <49601.89.247.126.95.1204280971.squirrel@mail.rezic.de>
plus version bump
p4raw-id: //depot/perl@33399
-rw-r--r-- | lib/Fatal.pm | 4 | ||||
-rwxr-xr-x | lib/Fatal.t | 8 |
2 files changed, 9 insertions, 3 deletions
diff --git a/lib/Fatal.pm b/lib/Fatal.pm index 69866d9f66..0b4bf9bc99 100644 --- a/lib/Fatal.pm +++ b/lib/Fatal.pm @@ -5,7 +5,7 @@ use Carp; use strict; our($AUTOLOAD, $Debug, $VERSION); -$VERSION = 1.05; +$VERSION = 1.06; $Debug = 0 unless defined $Debug; @@ -106,7 +106,7 @@ sub _make_fatal { $proto = eval { prototype "CORE::$name" }; die "$name is neither a builtin, nor a Perl subroutine" if $@; - die "Cannot make a non-overridable builtin fatal" + die "Cannot make the non-overridable builtin $name fatal" if not defined $proto; $core = 1; $call = "CORE::$name"; diff --git a/lib/Fatal.t b/lib/Fatal.t index cc7d1f213a..29d150d4ec 100755 --- a/lib/Fatal.t +++ b/lib/Fatal.t @@ -3,7 +3,7 @@ BEGIN { chdir 't' if -d 't'; @INC = '../lib'; - print "1..15\n"; + print "1..16\n"; } use strict; @@ -34,3 +34,9 @@ print "ok $i\n"; ++$i; eval { my $a = opendir FOO, 'lkjqweriuapofukndajsdlfjnvcvn' }; print "not " if $@ =~ /^Can't open/; print "ok $i\n"; ++$i; + +eval { Fatal->import(qw(print)) }; +if ($@ !~ m{Cannot make the non-overridable builtin print fatal}) { + print "not "; +} +print "ok $i\n"; ++$i; |