Revert "lists: Add list literal doc example."
[factor.git] / extra / cuckoo-filters / cuckoo-filters-tests.factor
blobaf2d363b076dceae464709b51629c74f8161ead9
1 USING: accessors combinators combinators.short-circuit
2 cuckoo-filters kernel math.parser sequences tools.test ;
4 { t 1 t t f 0 } [
5     "factor" 100 <cuckoo-filter> {
6         [ cuckoo-insert ]
7         [ nip size>> ]
8         [ cuckoo-lookup ]
9         [ cuckoo-delete ]
10         [ cuckoo-lookup ]
11         [ nip size>> ]
12     } 2cleave
13 ] unit-test
15 { 250,000 250,000 0 } [
16     250,000 <cuckoo-filter>
17     250,000 [ number>string ] { } map-integers
18     [
19         [
20             {
21                 [ over cuckoo-lookup not ]
22                 [ over cuckoo-insert ]
23             } 1&&
24         ] count swap
25     ]
26     [ [ over cuckoo-lookup ] count swap ]
27     [ [ over cuckoo-delete drop ] each ] tri
28     size>>
29 ] unit-test