Checking in changes prior to tagging of version 2.73.
[MogileFS-Server.git] / t / util.t
blob2d80a0459bb10040d4bee71b020bb383ccf288e2
1 #!/usr/bin/perl
3 use strict;
4 use warnings;
5 use Test::More;
6 use MogileFS::Util qw(weighted_list);
8 my %first;
9 for (1..100) {
10 my @l = weighted_list(["A", 0.1], ["B", 0.3]);
11 $first{$l[0]}++;
14 # conservative when playing with randomness
15 ok($first{"B"} >= ($first{"A"} * 1.8), "weightest list");
17 done_testing();