summaryrefslogtreecommitdiff
path: root/t/op
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2010-09-16 14:07:13 +0200
committerRafael Garcia-Suarez <rgs@consttype.org>2010-09-16 14:07:13 +0200
commit95961f2bb1706f8782e09e22425d5958169ef5cd (patch)
tree38eecf1ae15a4033500a3491320ab04b168463f9 /t/op
parent1a7c1a8ac3571ba89254e7a8641c72a66c90b463 (diff)
downloadperl-95961f2bb1706f8782e09e22425d5958169ef5cd.tar.gz
change warn.t to use test.pl
Diffstat (limited to 't/op')
-rw-r--r--t/op/warn.t24
1 files changed, 13 insertions, 11 deletions
diff --git a/t/op/warn.t b/t/op/warn.t
index ec3b9ca67f..571dfb011c 100644
--- a/t/op/warn.t
+++ b/t/op/warn.t
@@ -1,12 +1,14 @@
#!./perl
#line 3 warn.t
-print "1..18\n";
-my $test_num = 0;
-sub ok {
- print $_[0] ? "" : "not ", "ok ", ++$test_num, "\n";
+BEGIN {
+ chdir 't' if -d 't';
+ @INC = '../lib';
+ require './test.pl';
}
+plan 18;
+
my @warnings;
my $wa = []; my $ea = [];
$SIG{__WARN__} = sub { push @warnings, $_[0] };
@@ -24,7 +26,7 @@ ok @warnings==1 && $warnings[0] eq "foobar\n";
@warnings = ();
$@ = "";
warn "foo";
-ok @warnings==1 && $warnings[0] eq "foo at warn.t line 26.\n";
+ok @warnings==1 && $warnings[0] eq "foo at warn.t line 28.\n";
@warnings = ();
$@ = "";
@@ -35,13 +37,13 @@ ok @warnings==1 && ref($warnings[0]) eq "ARRAY" && $warnings[0] == $wa;
$@ = "";
warn "";
ok @warnings==1 &&
- $warnings[0] eq "Warning: something's wrong at warn.t line 36.\n";
+ $warnings[0] eq "Warning: something's wrong at warn.t line 38.\n";
@warnings = ();
$@ = "";
warn;
ok @warnings==1 &&
- $warnings[0] eq "Warning: something's wrong at warn.t line 42.\n";
+ $warnings[0] eq "Warning: something's wrong at warn.t line 44.\n";
@warnings = ();
$@ = "ERR\n";
@@ -56,7 +58,7 @@ ok @warnings==1 && $warnings[0] eq "foobar\n";
@warnings = ();
$@ = "ERR\n";
warn "foo";
-ok @warnings==1 && $warnings[0] eq "foo at warn.t line 58.\n";
+ok @warnings==1 && $warnings[0] eq "foo at warn.t line 60.\n";
@warnings = ();
$@ = "ERR\n";
@@ -67,13 +69,13 @@ ok @warnings==1 && ref($warnings[0]) eq "ARRAY" && $warnings[0] == $wa;
$@ = "ERR\n";
warn "";
ok @warnings==1 &&
- $warnings[0] eq "ERR\n\t...caught at warn.t line 68.\n";
+ $warnings[0] eq "ERR\n\t...caught at warn.t line 70.\n";
@warnings = ();
$@ = "ERR\n";
warn;
ok @warnings==1 &&
- $warnings[0] eq "ERR\n\t...caught at warn.t line 74.\n";
+ $warnings[0] eq "ERR\n\t...caught at warn.t line 76.\n";
@warnings = ();
$@ = $ea;
@@ -88,7 +90,7 @@ ok @warnings==1 && $warnings[0] eq "foobar\n";
@warnings = ();
$@ = $ea;
warn "foo";
-ok @warnings==1 && $warnings[0] eq "foo at warn.t line 90.\n";
+ok @warnings==1 && $warnings[0] eq "foo at warn.t line 92.\n";
@warnings = ();
$@ = $ea;