From: Slaven Rezic Date: Fri, 29 Feb 2008 11:29:31 +0000 (+0100) Subject: More diagnostics for Fatal.pm X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=df029878ce10ba115451deaf98191420c0c2f438;p=p5sagit%2Fp5-mst-13.2.git 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 --- diff --git a/lib/Fatal.pm b/lib/Fatal.pm index 69866d9..0b4bf9b 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 cc7d1f2..29d150d 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;