File: defaults.t

package info (click to toggle)
libbloom-filter-perl 1.2-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 132 kB
  • sloc: perl: 166; makefile: 2
file content (21 lines) | stat: -rw-r--r-- 549 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/perl -w

use Test::More;

use Bloom::Filter;

my $bf = Bloom::Filter->new();

# default capacity should be 100;

is( $bf->capacity(), 100, "Default capacity ok" );
is( $bf->error_rate(), 0.001, "Default error rate ok" );
is( $bf->length(), 1438, "Length calculated properly" );

my $bf2 = Bloom::Filter->new( capacity => 1092, error_rate => .00001);

is( $bf2->capacity(), 1092, "Custom capacity ok" );
is( $bf2->error_rate(), 0.00001, "Custom error rate ok" );
is( $bf2->length(), 26172, "Length calculated properly" );

done_testing();