Change 20557 by [EMAIL PROTECTED] on 2003/08/07 18:15:57

        Integrate:
        [ 20556]
        The #20546 was too ambitious, broke the test.

Affected files ...

... //depot/maint-5.8/perl/lib/Benchmark.pm#5 integrate
... //depot/maint-5.8/perl/lib/Benchmark.t#7 integrate

Differences ...

==== //depot/maint-5.8/perl/lib/Benchmark.pm#5 (text) ====
Index: perl/lib/Benchmark.pm
--- perl/lib/Benchmark.pm#4~20549~      Thu Aug  7 08:07:48 2003
+++ perl/lib/Benchmark.pm       Thu Aug  7 11:15:57 2003
@@ -485,19 +485,39 @@
 # The cache needs two branches: 's' for strings and 'c' for code.  The
 # empty loop is different in these two cases.
 
-sub clearcache ($) {
+$_Usage{clearcache} = <<'USAGE';
+usage: clearcache($count);
+USAGE
+
+sub clearcache    { 
+    die usage unless @_ == 1;
     delete $Cache{"$_[0]c"}; delete $Cache{"$_[0]s"}; 
 }
 
-sub clearallcache () { 
+$_Usage{clearallcache} = <<'USAGE';
+usage: clearallcache();
+USAGE
+
+sub clearallcache { 
+    die usage if @_;
     %Cache = (); 
 }
 
-sub enablecache () {
+$_Usage{enablecache} = <<'USAGE';
+usage: enablecache();
+USAGE
+
+sub enablecache   {
+    die usage if @_;
     $Do_Cache = 1; 
 }
 
-sub disablecache  () {
+$_Usage{disablecache} = <<'USAGE';
+usage: disablecache();
+USAGE
+
+sub disablecache  {
+    die usage if @_;
     $Do_Cache = 0; 
 }
 

==== //depot/maint-5.8/perl/lib/Benchmark.t#7 (text) ====
Index: perl/lib/Benchmark.t
--- perl/lib/Benchmark.t#6~20549~       Thu Aug  7 08:07:48 2003
+++ perl/lib/Benchmark.t        Thu Aug  7 11:15:57 2003
@@ -583,7 +583,7 @@
 
     foreach my $func (@takes_no_args) {
         eval "$func(42)";
-        like( $@, qr/Too many arguments for Benchmark::$func/, "$func usage: with 
args" );
+        is( $@, $usage{$func}, "$func usage: with args" );
     }
 }
 
End of Patch.

Reply via email to