From: Nicholas Clark Date: Sun, 28 Jan 2007 22:30:18 +0000 (+0000) Subject: Convert ext/B/t/debug.t to Test::More. (Diagnostics are good, m'kay) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f071ed12d768b92e96fb1ecf3f2ac6262bc75f07;p=p5sagit%2Fp5-mst-13.2.git Convert ext/B/t/debug.t to Test::More. (Diagnostics are good, m'kay) p4raw-id: //depot/perl@30052 --- diff --git a/ext/B/t/debug.t b/ext/B/t/debug.t index 0e502ee..225385e 100755 --- a/ext/B/t/debug.t +++ b/ext/B/t/debug.t @@ -23,13 +23,7 @@ $| = 1; use warnings; use strict; use Config; - -print "1..3\n"; - -my $test = 1; - -sub ok { print "ok $test\n"; $test++ } - +use Test::More tests=>3; my $a; my $Is_VMS = $^O eq 'VMS'; @@ -39,15 +33,11 @@ my $path = join " ", map { qq["-I$_"] } @INC; my $redir = $Is_MacOS ? "" : "2>&1"; $a = `$^X $path "-MO=Debug" -e 1 $redir`; -print "not " unless $a =~ -/\bLISTOP\b.*\bOP\b.*\bCOP\b.*\bOP\b/s; -ok; +like($a, qr/\bLISTOP\b.*\bOP\b.*\bCOP\b.*\bOP\b/s); $a = `$^X $path "-MO=Terse" -e 1 $redir`; -print "not " unless $a =~ -/\bLISTOP\b.*leave.*\n OP\b.*enter.*\n COP\b.*nextstate.*\n OP\b.*null/s; -ok; +like($a, qr/\bLISTOP\b.*leave.*\n OP\b.*enter.*\n COP\b.*nextstate.*\n OP\b.*null/s); $a = `$^X $path "-MO=Terse" -ane "s/foo/bar/" $redir`; $a =~ s/\(0x[^)]+\)//g; @@ -74,6 +64,5 @@ EOF } $b=~s/\n/ /g;$b=~s/\s+/ /g; $b =~ s/\s+$//; -print "# [$a]\n# vs\n# [$b]\nnot " if $a ne $b; -ok; +is($a, $b);