In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/63811f136c08caeb3164762992e5168c1d4d758d?hp=86f11a3d4085bbaf2b72fce18f55bd5a0cfc46d3>
- Log ----------------------------------------------------------------- commit 63811f136c08caeb3164762992e5168c1d4d758d Author: Colin Kuskie (via RT) <[email protected]> Date: Sat Sep 8 15:31:53 2012 -0700 Refactor t/op/cond.t to use test.pl instead of making TAP by hand M t/op/cond.t commit 6944c18b75609b4a2cfdc17a74adaa3d26e7fa88 Author: Colin Kuskie (via RT) <[email protected]> Date: Sun Sep 9 17:32:53 2012 -0700 Refactor t/porting/customized to use test.pl instead of making TAP by hand M t/porting/customized.t ----------------------------------------------------------------------- Summary of changes: t/op/cond.t | 16 +++++++++++----- t/porting/customized.t | 14 +++++--------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/t/op/cond.t b/t/op/cond.t index 0a0d1e1..acf0704 100644 --- a/t/op/cond.t +++ b/t/op/cond.t @@ -1,10 +1,16 @@ #!./perl -print "1..4\n"; +BEGIN { + chdir 't' if -d 't'; + @INC = '../lib'; + require './test.pl'; +} -print 1 ? "ok 1\n" : "not ok 1\n"; # compile time -print 0 ? "not ok 2\n" : "ok 2\n"; +is( 1 ? 1 : 0, 1, 'compile time, true' ); +is( 0 ? 0 : 1, 1, 'compile time, false' ); $x = 1; -print $x ? "ok 3\n" : "not ok 3\n"; # run time -print !$x ? "not ok 4\n" : "ok 4\n"; +is( $x ? 1 : 0, 1, 'run time, true'); +is( !$x ? 0 : 1, 1, 'run time, false'); + +done_testing(); diff --git a/t/porting/customized.t b/t/porting/customized.t index 76053bc..631c1bc 100644 --- a/t/porting/customized.t +++ b/t/porting/customized.t @@ -10,7 +10,8 @@ BEGIN { # XXX that should be fixed chdir '..' unless -d 't'; - @INC = qw(lib Porting); + @INC = qw(lib Porting t); + require 'test.pl'; } use strict; @@ -99,21 +100,16 @@ foreach my $module ( keys %Modules ) { next; } my $should_be = $customised{ $module }->{ $file }; - if ( $id ne $should_be ) { - print "not ok ".++$TestCounter." - SHA for $file does not match stashed SHA\n"; - } - else { - print "ok ".++$TestCounter." - SHA for $file matched\n"; - } + is( $id, $should_be, "SHA for $file matches stashed SHA" ); } } if ( $regen ) { - print "ok ".++$TestCounter." - regenerated data file\n"; + pass( "regenerated data file" ); close $data_fh; } -print "1..".$TestCounter."\n"; +done_testing(); =pod -- Perl5 Master Repository
