From: Nicholas Clark Date: Wed, 18 Jan 2006 10:02:19 +0000 (+0000) Subject: New t/comp/require.t tests should go before the conditional exit. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=57f3ff92693b4f4d5c5142144ad578931b7cec80;p=p5sagit%2Fp5-mst-13.2.git New t/comp/require.t tests should go before the conditional exit. p4raw-id: //depot/perl@26891 --- diff --git a/t/comp/require.t b/t/comp/require.t index ae3da43..5deb8ad 100755 --- a/t/comp/require.t +++ b/t/comp/require.t @@ -189,6 +189,16 @@ if($@ =~ /Directory .*threads not allowed in require/) { print "not ok $i\n"; } + +write_file('bleah.pm', qq(die "This is an expected error";\n)); +delete $INC{"bleah.pm"}; ++$::i; +eval { CORE::require bleah; }; +if ($@ =~ /^This is an expected error/) { + print "ok $i\n"; +} else { + print "not ok $i\n"; +} + ############################ #### Add new tests here #### ############################ @@ -209,15 +219,6 @@ sub bytes_to_utf16 { $i++; do_require(bytes_to_utf16('n', qq(print "ok $i\\n"; 1;\n), 1)); # BE $i++; do_require(bytes_to_utf16('v', qq(print "ok $i\\n"; 1;\n), 1)); # LE -write_file('bleah.pm', qq(die "This is an expected error";\n)); -delete $INC{"bleah.pm"}; ++$::i; -eval { CORE::require bleah; }; -if ($@ =~ /^This is an expected error/) { - print "ok $i\n"; -} else { - print "not ok $i\n"; -} - END { 1 while unlink 'bleah.pm'; 1 while unlink 'bleah.do';