From: Andrew Rodland Date: Sat, 14 Nov 2009 09:08:46 +0000 (-0600) Subject: Add tests. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=68a00014b571d4710c4547f0636aeb35e307c012;p=p5sagit%2Fp5-mst-13.2.git Add tests. --- diff --git a/t/lib/warnings/9enabled b/t/lib/warnings/9enabled index a6ad931..a535689 100644 --- a/t/lib/warnings/9enabled +++ b/t/lib/warnings/9enabled @@ -1227,3 +1227,60 @@ print "ok2\n" if $@ =~ /line $warn_line/; EXPECT ok1 ok2 +######## + +--FILE-- fatal1.pm +package fatal1 ; +no warnings ; +print "ok1\n" if !warnings::fatal_enabled('all') ; +print "ok2\n" if !warnings::fatal_enabled("syntax") ; +1; +--FILE-- +use fatal1 ; +EXPECT +ok1 +ok2 +######## + +--FILE-- fatal2.pm +package fatal2; +no warnings ; +print "ok1\n" if !warnings::fatal_enabled('all') ; +print "ok2\n" if warnings::fatal_enabled("syntax") ; +1; +--FILE-- +use warnings FATAL => 'syntax' ; +use fatal2 ; +EXPECT +ok1 +ok2 +######## + +--FILE-- fatal3.pm +package fatal3 ; +no warnings ; +print "ok1\n" if warnings::fatal_enabled('all') ; +print "ok2\n" if warnings::fatal_enabled("syntax") ; +1; +--FILE-- +use warnings FATAL => 'all' ; +use fatal3 ; +EXPECT +ok1 +ok2 +######## + +--FILE-- fatal4.pm +package fatal4 ; +no warnings ; +print "ok1\n" if !warnings::fatal_enabled('all') ; +print "ok2\n" if warnings::fatal_enabled("void") ; +print "ok3\n" if !warnings::fatal_enabled("syntax") ; +1; +--FILE-- +use warnings FATAL => 'all', NONFATAL => 'syntax' ; +use fatal4 ; +EXPECT +ok1 +ok2 +ok3