Skip to content

Commit dc10d42

Browse files
committed
Add test-support feature
1 parent 2f3b3e1 commit dc10d42

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

crates/geo_filters/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ bench = false
1414

1515
[features]
1616
default = []
17+
test-support = []
1718
serde = ["dep:serde"]
1819
evaluation = [
1920
"dep:clap",

crates/geo_filters/src/diff_count.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ impl<'a, C: GeoConfig<Diff>> GeoDiffCount<'a, C> {
340340
Ok(bytes_written)
341341
}
342342

343-
#[cfg(test)]
343+
#[cfg(any(test, feature = "test-support"))]
344344
pub fn from_ones(config: C, ones: impl IntoIterator<Item = C::BucketType>) -> Self {
345345
let mut result = Self::new(config);
346346
for one in ones {
@@ -349,13 +349,13 @@ impl<'a, C: GeoConfig<Diff>> GeoDiffCount<'a, C> {
349349
result
350350
}
351351

352-
#[cfg(test)]
352+
#[cfg(any(test, feature = "test-support"))]
353353
pub fn iter_ones(&self) -> impl Iterator<Item = C::BucketType> + '_ {
354354
iter_ones(self.bit_chunks().peekable()).map(C::BucketType::from_usize)
355355
}
356356

357357
/// Generate a pseudo-random filter. For a given number of items
358-
#[cfg(test)]
358+
#[cfg(any(test, feature = "test-support"))]
359359
pub fn pseudorandom_filter(config: C, items: usize) -> Self {
360360
use rand::RngCore;
361361
use rand_chacha::rand_core::SeedableRng;

0 commit comments

Comments
 (0)