Skip to content

Commit ea774b5

Browse files
committed
remove readme test and make readme doc tests
1 parent 132a244 commit ea774b5

2 files changed

Lines changed: 4 additions & 19 deletions

File tree

crates/geo_filters/src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff 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;

crates/geo_filters/tests/public_api.rs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,5 @@
11
use 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]
234
fn can_use_predefined_diff_count() {
245
use geo_filters::diff_count::GeoDiffCount7;

0 commit comments

Comments
 (0)