In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/38294c45e93c4b9374fd7503278ba8e3e030bb3c?hp=04b0a66913c4569841be4ef05a48019f0924d4c2>

- Log -----------------------------------------------------------------
commit 38294c45e93c4b9374fd7503278ba8e3e030bb3c
Author: Nicholas Clark <[email protected]>
Date:   Fri Dec 17 09:31:11 2010 +0000

    In dbmt_common.pl, change checkOutput(...) to 5 calls to is().
    
    Replacing a 5 armed boolean fed to ok() with 5 calls to is() gives much 
better
    diagnostics on failure.
-----------------------------------------------------------------------

Summary of changes:
 t/lib/dbmt_common.pl |   34 ++++++++++++++++++----------------
 1 files changed, 18 insertions(+), 16 deletions(-)

diff --git a/t/lib/dbmt_common.pl b/t/lib/dbmt_common.pl
index 268b0d6..7ebdfab 100644
--- a/t/lib/dbmt_common.pl
+++ b/t/lib/dbmt_common.pl
@@ -232,10 +232,12 @@ unlink <Op_dbmx*>, $Dfile;
    sub checkOutput
    {
        my($fk, $sk, $fv, $sv) = @_;
-       return
-           $fetch_key eq $fk && $store_key eq $sk &&
-          $fetch_value eq $fv && $store_value eq $sv &&
-          $_ eq 'original';
+       local $Test::Builder::Level = $Test::Builder::Level + 1;
+       is($fetch_key, $fk);
+       is($store_key, $sk);
+       is($fetch_value, $fv);
+       is($store_value, $sv);
+       is($_, 'original');
    }
 
    unlink <Op_dbmx*>;
@@ -251,17 +253,17 @@ unlink <Op_dbmx*>, $Dfile;
 
    $h{"fred"} = "joe";
    #                   fk   sk     fv   sv
-   ok(checkOutput("", "fred", "", "joe"));
+   checkOutput("", "fred", "", "joe");
 
    ($fetch_key, $store_key, $fetch_value, $store_value) = ("") x 4;
    is($h{"fred"}, "joe");
    #                   fk    sk     fv    sv
-   ok(checkOutput("", "fred", "joe", ""));
+   checkOutput("", "fred", "joe", "");
 
    ($fetch_key, $store_key, $fetch_value, $store_value) = ("") x 4;
    is($db->FIRSTKEY(), "fred");
    #                    fk     sk  fv  sv
-   ok(checkOutput("fred", "", "", ""));
+   checkOutput("fred", "", "", "");
 
    # replace the filters, but remember the previous set
    my ($old_fk) = $db->filter_fetch_key
@@ -276,17 +278,17 @@ unlink <Op_dbmx*>, $Dfile;
    ($fetch_key, $store_key, $fetch_value, $store_value) = ("") x 4;
    $h{"Fred"} = "Joe";
    #                   fk   sk     fv    sv
-   ok(checkOutput("", "fred", "", "Jxe"));
+   checkOutput("", "fred", "", "Jxe");
 
    ($fetch_key, $store_key, $fetch_value, $store_value) = ("") x 4;
    is($h{"Fred"}, "[Jxe]");
    #                   fk   sk     fv    sv
-   ok(checkOutput("", "fred", "[Jxe]", ""));
+   checkOutput("", "fred", "[Jxe]", "");
 
    ($fetch_key, $store_key, $fetch_value, $store_value) = ("") x 4;
    is($db->FIRSTKEY(), "FRED");
    #                   fk   sk     fv    sv
-   ok(checkOutput("FRED", "", "", ""));
+   checkOutput("FRED", "", "", "");
 
    # put the original filters back
    $db->filter_fetch_key   ($old_fk);
@@ -296,15 +298,15 @@ unlink <Op_dbmx*>, $Dfile;
 
    ($fetch_key, $store_key, $fetch_value, $store_value) = ("") x 4;
    $h{"fred"} = "joe";
-   ok(checkOutput("", "fred", "", "joe"));
+   checkOutput("", "fred", "", "joe");
 
    ($fetch_key, $store_key, $fetch_value, $store_value) = ("") x 4;
    is($h{"fred"}, "joe");
-   ok(checkOutput("", "fred", "joe", ""));
+   checkOutput("", "fred", "joe", "");
 
    ($fetch_key, $store_key, $fetch_value, $store_value) = ("") x 4;
    is($db->FIRSTKEY(), "fred");
-   ok(checkOutput("fred", "", "", ""));
+   checkOutput("fred", "", "", "");
 
    # delete the filters
    $db->filter_fetch_key   (undef);
@@ -314,15 +316,15 @@ unlink <Op_dbmx*>, $Dfile;
 
    ($fetch_key, $store_key, $fetch_value, $store_value) = ("") x 4;
    $h{"fred"} = "joe";
-   ok(checkOutput("", "", "", ""));
+   checkOutput("", "", "", "");
 
    ($fetch_key, $store_key, $fetch_value, $store_value) = ("") x 4;
    is($h{"fred"}, "joe");
-   ok(checkOutput("", "", "", ""));
+   checkOutput("", "", "", "");
 
    ($fetch_key, $store_key, $fetch_value, $store_value) = ("") x 4;
    is($db->FIRSTKEY(), "fred");
-   ok(checkOutput("", "", "", ""));
+   checkOutput("", "", "", "");
 
    undef $db;
    untie %h;

--
Perl5 Master Repository

Reply via email to