File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -51,3 +51,7 @@ pub trait Count<M: Method> {
5151 /// Returns the number of bytes in memory used to represent this filter.
5252 fn bytes_in_memory ( & self ) -> usize ;
5353}
54+
55+ #[ doc = include_str ! ( "../README.md" ) ]
56+ #[ cfg( doctest) ]
57+ pub struct ReadmeDocTests ;
Original file line number Diff line number Diff line change 11use geo_filters:: build_hasher:: UnstableDefaultBuildHasher ;
22
3- // Mirrors what we have in the README.
4- // If this breaks then it should be fixed an the readme updated.
5- #[ test]
6- fn readme ( ) {
7- use geo_filters:: distinct_count:: GeoDistinctCount13 ;
8- use geo_filters:: Count ;
9-
10- let mut c1 = GeoDistinctCount13 :: default ( ) ;
11- c1. push ( 1 ) ;
12- c1. push ( 2 ) ;
13-
14- let mut c2 = GeoDistinctCount13 :: default ( ) ;
15- c2. push ( 2 ) ;
16- c2. push ( 3 ) ;
17-
18- let estimated_size = c1. size_with_sketch ( & c2) ;
19- assert ! ( ( 3.0_f32 * 0.9 ..=3.0_f32 * 1.1 ) . contains( & estimated_size) ) ;
20- }
21-
223#[ test]
234fn can_use_predefined_diff_count ( ) {
245 use geo_filters:: diff_count:: GeoDiffCount7 ;
You can’t perform that action at this time.
0 commit comments