Fix some bugs in tests
This commit is contained in:
parent
b49a2322d9
commit
2503b12bdd
@ -31,7 +31,7 @@ sub gen_password(;$$)
|
||||
my $pass = shift // `pwgen -s -n -c -y -1 42 1`;
|
||||
chomp($pass);
|
||||
|
||||
open SECRET, ">", $file;
|
||||
open SECRET, ">", $file or die $!;
|
||||
print SECRET encode_base64(cxor($pass, $hostname));
|
||||
close SECRET;
|
||||
|
||||
@ -43,7 +43,7 @@ sub get_password(;$)
|
||||
my $file = shift // ".secret_intra";
|
||||
|
||||
my $decode = "";
|
||||
open SECRET, "<", $file;
|
||||
open SECRET, "<", $file or die $file.': '.$!;
|
||||
while (<SECRET>) {
|
||||
$decode .= $_;
|
||||
}
|
||||
|
@ -4,13 +4,15 @@ use warnings;
|
||||
|
||||
use Test::More;
|
||||
|
||||
use lib "../";
|
||||
|
||||
BEGIN {
|
||||
diag("Testing Process on perl $]");
|
||||
use_ok('Gearman::Worker');
|
||||
use_ok('Process');
|
||||
use_ok('ACU::Process');
|
||||
}
|
||||
|
||||
use Process;
|
||||
use ACU::Process;
|
||||
|
||||
cmp_ok($Process::nb_cpus, 'gt', 0, 'Check number of CPU detected');
|
||||
|
||||
@ -40,7 +42,7 @@ is(Process::do_work(sub { $_[1]->{auth} }, { "test" => "It works" }, 100, $gearm
|
||||
|
||||
is(Process::do_work(sub { $_[1]->{param}->{param1} }, { "test" => "It works" }, 100, $gearman_simulation), 'length', "Check returning named parameter");
|
||||
is(Process::do_work(sub { $_[1]->{param}->{argument2} }, { "test" => "It works" }, 100, $gearman_simulation), 'size', "Check returning named parameter");
|
||||
is(Process::do_work(sub { $_[1]->{param}->{3} }, { "test" => "It works" }, 100, $gearman_simulation), 'third', "Check returning unnamed parameter");
|
||||
is(Process::do_work(sub { $_[1]->{param}->{1} }, { "test" => "It works" }, 100, $gearman_simulation), 'third', "Check returning unnamed parameter");
|
||||
|
||||
is(Process::do_work(sub { $_[1]->{subtree} }, { "test" => "It works" }, 100, $gearman_simulation), undef, "Check there are no subtree");
|
||||
|
||||
|
Reference in New Issue
Block a user