mirror of
https://github.com/hoytech/strfry.git
synced 2025-06-20 01:40:29 +00:00
wip
This commit is contained in:
@ -8,24 +8,37 @@ my $idSize = 16;
|
||||
srand($ENV{SEED} || 0);
|
||||
my $stgen = Session::Token->new(seed => "\x00" x 1024, alphabet => '0123456789abcdef', length => $idSize * 2);
|
||||
|
||||
my $pid = open2(my $outfile, my $infile, './test/xor');
|
||||
|
||||
my $num = rnd(10000) + 1;
|
||||
while(1) {
|
||||
my $pid = open2(my $outfile, my $infile, './test/xor');
|
||||
|
||||
for (1..$num) {
|
||||
my $mode = rnd(3) + 1;
|
||||
my $created = 1677970534 + rnd($num);
|
||||
my $id = $stgen->get;
|
||||
print $infile "$mode,$created,$id\n";
|
||||
my $num = rnd(10000) + 1;
|
||||
|
||||
for (1..$num) {
|
||||
my $mode;
|
||||
if (rand() < 0.001) {
|
||||
$mode = rnd(2) + 1;
|
||||
} else {
|
||||
$mode = 3;
|
||||
}
|
||||
my $created = 1677970534 + rnd($num);
|
||||
my $id = $stgen->get;
|
||||
print $infile "$mode,$created,$id\n";
|
||||
}
|
||||
|
||||
close($infile);
|
||||
|
||||
while (<$outfile>) {
|
||||
print $_;
|
||||
}
|
||||
|
||||
waitpid($pid, 0);
|
||||
my $child_exit_status = $?;
|
||||
die "failure" if $child_exit_status;
|
||||
|
||||
print "\n-----------OK-----------\n";
|
||||
}
|
||||
|
||||
close($infile);
|
||||
|
||||
while (<$outfile>) {
|
||||
print $_;
|
||||
}
|
||||
|
||||
|
||||
|
||||
sub rnd {
|
||||
my $n = shift;
|
||||
|
Reference in New Issue
Block a user