repo.or.cz
/
MogileFS-Server.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Checking in changes prior to tagging of version 2.73.
[MogileFS-Server.git]
/
t
/
util.t
blob
2d80a0459bb10040d4bee71b020bb383ccf288e2
1
#!/usr/bin/perl
2
3
use
strict
;
4
use
warnings
;
5
use
Test
::
More
;
6
use
MogileFS
::
Util
qw(weighted_list)
;
7
8
my
%first
;
9
for
(
1
.
.100
) {
10
my
@l
=
weighted_list
([
"A"
,
0.1
], [
"B"
,
0.3
]);
11
$first
{
$l
[
0
]}++;
12
}
13
14
# conservative when playing with randomness
15
ok
(
$first
{
"B"
} >= (
$first
{
"A"
} *
1.8
),
"weightest list"
);
16
17
done_testing
();