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
fix return value of commands that clear_cache
[MogileFS-Server.git]
/
t
/
util.t
blob
76cf0df55221a227416dd81c928285a3156ba28b
1
#!/usr/bin/perl
2
3
use
strict
;
4
use
warnings
;
5
use
Test
::
More
;
6
use
MogileFS
::
Util
qw(weighted_list)
;
7
8
plan tests
=>
1
;
9
10
my
%first
;
11
for
(
1
.
.100
) {
12
my
@l
=
weighted_list
([
"A"
,
0.1
], [
"B"
,
0.3
]);
13
$first
{
$l
[
0
]}++;
14
}
15
16
# conservative when playing with randomness
17
ok
(
$first
{
"B"
} >= (
$first
{
"A"
} *
1.8
),
"weightest list"
);
18
19