[Bps-public-commit] r11355 - in SVN-PropDB/lib/Prophet: .

clkao at bestpractical.com clkao at bestpractical.com
Tue Apr 1 21:22:44 EDT 2008


Author: clkao
Date: Tue Apr  1 21:22:44 2008
New Revision: 11355

Modified:
   SVN-PropDB/lib/Prophet/Test.pm
   SVN-PropDB/lib/Prophet/Test/Arena.pm
   SVN-PropDB/lib/Prophet/Test/Participant.pm

Log:
misc cleanups for tests.


Modified: SVN-PropDB/lib/Prophet/Test.pm
==============================================================================
--- SVN-PropDB/lib/Prophet/Test.pm	(original)
+++ SVN-PropDB/lib/Prophet/Test.pm	Tue Apr  1 21:22:44 2008
@@ -74,7 +74,6 @@
    my $msg = shift if (@_);
    
    @_ = sub {
-   
       my ($ret, $stdout,$stderr) = (run_script($script, $args), $msg);
       @_ = ($ret,$msg);
       goto &Test::More::ok;
@@ -224,8 +223,11 @@
   local $ENV{'PROPHET_USER'} = $username;
   local $ENV{'PROPHET_REPO'} = repo_path_for($username);
 #  diag("I am $username. My replica id is ".replica_uuid());
- my $ret=  $coderef->();
- $REPLICA_UUIDS{$username} = replica_uuid();
+
+  $REPLICA_UUIDS{$username} = replica_uuid();
+
+  my $ret=  $coderef->();
+
  return $ret;
 }
 

Modified: SVN-PropDB/lib/Prophet/Test/Arena.pm
==============================================================================
--- SVN-PropDB/lib/Prophet/Test/Arena.pm	(original)
+++ SVN-PropDB/lib/Prophet/Test/Arena.pm	Tue Apr  1 21:22:44 2008
@@ -60,7 +60,10 @@
     }
         my $next_result = $args->{result};
 
-        as_user($chicken->name, sub { $chicken->take_one_step($action, $args ) });
+        as_user($chicken->name, sub {
+                    @_ = ($chicken, $action, $args);
+                    goto $chicken->can('take_one_step');
+                });
 
         if ($args->{result}) {
             $record_map->{ $next_result } = $args->{result};

Modified: SVN-PropDB/lib/Prophet/Test/Participant.pm
==============================================================================
--- SVN-PropDB/lib/Prophet/Test/Participant.pm	(original)
+++ SVN-PropDB/lib/Prophet/Test/Participant.pm	Tue Apr  1 21:22:44 2008
@@ -35,7 +35,8 @@
     my $self   = shift;
     my $action = shift || ( shuffle(@CHICKEN_DO) )[0];
     my $args   = shift;
-    $self->$action($args);
+    @_ = ($self, $args);
+    goto $self->can($action);
 }
 
 
@@ -122,9 +123,10 @@
 
     $self->record_action('sync_from_peer', $args);
 
-    eval { run_ok( 'prophet-merge',
+    @_ = ( 'prophet-merge',
             [ '--prefer', 'to', '--from', repo_uri_for($from),
-                '--to', repo_uri_for($self->name) ], $self->name . " sync from " . $from . " ran ok!" ); };
+                '--to', repo_uri_for($self->name) ], $self->name . " sync from " . $from . " ran ok!" );
+    goto \&run_ok;
 
 }
 



More information about the Bps-public-commit mailing list