Skip to content

Commit

Permalink
Update test.pl to keep running the plugin until it stops yielding out…
Browse files Browse the repository at this point in the history
…put.

This results in full test output from parrotlog.pm.
  • Loading branch information
Infinoid committed Feb 24, 2009
1 parent 55a442a commit 50ffb2b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion test.pl
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,28 @@
$module = "modules::local::$module";
my $inst = $module;

my $output_anything = 0;

sub run_function {
my $function = shift;
$output_anything = 0;
$inst->$function();
}

run_function("init");

sub create_timer {
my ($timername, $self, $functionname, $timeout) = @_;
run_function($functionname) for (0..1);
$output_anything = 1;
run_function($functionname);
$output_anything = 1;
run_function($functionname) while $output_anything;
}

my $lastline;
sub send_privmsg {
my ($network, $channel, $line) = @_;
$output_anything = 1;
# module may output the same line to multiple channels; detect that here.
if(defined($lastline) && ($line eq $lastline)) {
return;
Expand Down

0 comments on commit 50ffb2b

Please sign in to comment.