develooper Front page | perl.perl5.changes | Postings from August 2012

[perl.git] branch blead, updated. v5.17.3-180-g28453e5

From:
Nicholas Clark
Date:
August 29, 2012 13:33
Subject:
[perl.git] branch blead, updated. v5.17.3-180-g28453e5
Message ID:
E1T6ox3-0002n7-Re@camel.ams6.corp.booking.com
In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/28453e5f3d3167d0f1a72abc434059ee99c2ef96?hp=51e1fe85f60b4794a6d7a9bd935381c9af035e49>

- Log -----------------------------------------------------------------
commit 28453e5f3d3167d0f1a72abc434059ee99c2ef96
Author: Nicholas Clark <nick@ccl4.org>
Date:   Wed Aug 29 22:23:19 2012 +0200

    Remove a no-longer needed lexical from t/op/lop.t
    
    Jim Keenan spotted the commented out code referencing the variable $test.
    Turns out that it is completely redundant, so its declaration can go too.

M	t/op/lop.t

commit 6f02a29952bee8a2f755ecdff8223ec5db30a97d
Author: Colin Kuskie <colink@perldreamer.com>
Date:   Fri Aug 10 20:24:09 2012 -0700

    Document the last five tests of t/op/lop.t

M	t/op/lop.t

commit 73ee8f56b01b1a87f68b11ab07bda9013c14f039
Author: Colin Kuskie <colink@perldreamer.com>
Date:   Sat Jul 28 14:14:45 2012 -0700

    Update t/op/lop.t to use test.pl instead of making TAP by hand.

M	t/op/lop.t

commit be250cb1944a1f97d0af80998b250d64e8a7b991
Author: Colin Kuskie <colink@perldreamer.com>
Date:   Wed Jul 18 18:35:19 2012 -0700

    Refactor t/uni/case.pl to use test.pl instead of making TAP by hand.

M	t/uni/case.pl

commit f986e774e7a2624029d321014c665b9491e32dcf
Author: Colin Kuskie <colink@perldreamer.com>
Date:   Tue Jul 17 22:21:21 2012 -0700

    Refactor t/porting/checkcase.t to use test.pl instead of making TAP by hand.

M	t/porting/checkcase.t

commit 09afc3e433a69b64f92f16c1fbb2f687d579be81
Author: Colin Kuskie <colink@perldreamer.com>
Date:   Tue Jul 17 22:07:54 2012 -0700

    Refactor t/re/no_utf8_pt.t to use test.pl instead of making TAP by hand.

M	t/re/no_utf8_pm.t
-----------------------------------------------------------------------

Summary of changes:
 t/op/lop.t            |   31 ++++++++++++-------------------
 t/porting/checkcase.t |   11 ++++-------
 t/re/no_utf8_pm.t     |   11 ++++++++---
 t/uni/case.pl         |   14 ++++----------
 4 files changed, 28 insertions(+), 39 deletions(-)

diff --git a/t/op/lop.t b/t/op/lop.t
index 2c2d2a6..bc4eb85 100644
--- a/t/op/lop.t
+++ b/t/op/lop.t
@@ -7,11 +7,11 @@
 BEGIN {
     chdir 't' if -d 't';
     @INC = '../lib';
+    require './test.pl';
 }
 
-print "1..11\n";
+plan tests => 17;
 
-my $test = 0;
 for my $i (undef, 0 .. 2, "", "0 but true") {
     my $true = 1;
     my $false = 0;
@@ -29,37 +29,30 @@ for my $i (undef, 0 .. 2, "", "0 but true") {
 	    and (($i || !$j) != (!$i && $j))
 	);
     }
-    if (not $true) {
-	print "not ";
-    } elsif ($false) {
-	print "not ";
-    }
-    print "ok ", ++$test, "\n";
+    my $m = ! defined $i ? 'undef'
+       : $i eq ''   ? 'empty string'
+       : $i;
+    ok( $true, "true: $m");
+    ok( ! $false, "false: $m");
 }
 
-# $test == 6
 my $i = 0;
 (($i ||= 1) &&= 3) += 4;
-print "not " unless $i == 7;
-print "ok ", ++$test, "\n";
+is( $i, 7, '||=, &&=');
 
 my ($x, $y) = (1, 8);
 $i = !$x || $y;
-print "not " unless $i == 8;
-print "ok ", ++$test, "\n";
+is( $i, 8, 'negation precedence with ||' );
 
 ++$y;
 $i = !$x || !$x || !$x || $y;
-print "not " unless $i == 9;
-print "ok ", ++$test, "\n";
+is( $i, 9, 'negation precedence with ||, multiple operands' );
 
 $x = 0;
 ++$y;
 $i = !$x && $y;
-print "not " unless $i == 10;
-print "ok ", ++$test, "\n";
+is( $i, 10, 'negation precedence with &&' );
 
 ++$y;
 $i = !$x && !$x && !$x && $y;
-print "not " unless $i == 11;
-print "ok ", ++$test, "\n";
+is( $i, 11, 'negation precedence with &&, multiple operands' );
diff --git a/t/porting/checkcase.t b/t/porting/checkcase.t
index 49f59e8..3c05e22 100644
--- a/t/porting/checkcase.t
+++ b/t/porting/checkcase.t
@@ -3,6 +3,7 @@
 
 BEGIN {
     @INC = '..' if -f '../TestInit.pm';
+    require './test.pl';
 }
 use TestInit qw(T); # T is chdir to the top level
 
@@ -36,12 +37,8 @@ find({no_chdir => 1, wanted => sub {
 	 }}, '.');
 
 foreach (sort values %files) {
-    if (@$_ > 1) {
-		print "not ok ".++$test_count. " - ". join(", ", @$_), "\n";
-		print STDERR "# $_\n" foreach @$_;
-    } else {
-		print "ok ".++$test_count. " - ". join(", ", @$_), "\n";
-	}
+    is( @$_, 1, join(", ", @$_) ) or
+        do{ note($_) foreach @$_; };
 }
 
-print "1..".$test_count."\n";
+done_testing();
diff --git a/t/re/no_utf8_pm.t b/t/re/no_utf8_pm.t
index 8e9dbb9..6595a24 100644
--- a/t/re/no_utf8_pm.t
+++ b/t/re/no_utf8_pm.t
@@ -1,6 +1,12 @@
 #!./perl
 
-print "1..1\n";
+BEGIN {
+    chdir 't' if -d 't';
+    @INC = '../lib';
+    require './test.pl';
+}
+
+plan tests => 1;
 
 # Make sure that case-insensitive matching of any Latin1 chars don't load
 # utf8.pm.  We assume that NULL won't force loading utf8.pm, and since it
@@ -8,5 +14,4 @@ print "1..1\n";
 # a swash if it thought there was one.
 "\0" =~ /[\001-\xFF]/i;
 
-print "not " if exists $INC{"utf8.pm"};
-print "ok 1\n";
+ok(! exists $INC{"utf8.pm"}, 'case insensitive matching of any Latin1 chars does not load utf8.pm');
diff --git a/t/uni/case.pl b/t/uni/case.pl
index aa6467c..08df670 100644
--- a/t/uni/case.pl
+++ b/t/uni/case.pl
@@ -88,9 +88,7 @@ sub casetest {
 	foreach my $func (@funcs) {
 	    my $d = $func->($c);
 	    my $e = unidump($d);
-	    print $d eq pack("U0U", $simple{$i}) ?
-		"ok $test # $i -> $w\n" : "not ok $test # $i -> $e ($w)\n";
-		$test++;
+	    is( $d, pack("U0U", $simple{$i}), "$i -> $e ($w)" );
 	}
     }
 
@@ -101,9 +99,7 @@ sub casetest {
 	foreach my $func (@funcs) {
 	    my $d = $func->($c);
 	    my $e = unidump($d);
-	    print $w eq $e ?
-		"ok $test # $i -> $w\n" : "not ok $test # $h -> $e ($w)\n";
-		$test++;
+            is( $w, $e, "$h -> $e ($w)" );
 	}
     }
 
@@ -113,13 +109,11 @@ sub casetest {
 	foreach my $func (@funcs) {
 	    my $d = $func->($c);
 	    my $e = unidump($d);
-	    print $d eq $c ?
-		"ok $test # $i -> $w\n" : "not ok $test # $i -> $e ($w)\n";
-		$test++;
+            is( $d, $c, "$i -> $e ($w)" );
 	}
     }
 
-    print "1..$tests\n";
+    done_testing();
 }
 
 1;

--
Perl5 Master Repository



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About