Skip to content

Commit b1bc383

Browse files
committed
small unit test for sanity
1 parent 59c0dd5 commit b1bc383

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

lib/collection/src/problems/unindexed_field.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -604,3 +604,20 @@ impl From<FieldIndexType> for PayloadFieldSchema {
604604
}
605605
}
606606
}
607+
608+
#[cfg(test)]
609+
mod tests {
610+
use super::*;
611+
#[test]
612+
fn integer_index_capacities() {
613+
let params = PayloadSchemaParams::Integer(IntegerIndexParams {
614+
lookup: Some(true),
615+
range: Some(true),
616+
..Default::default()
617+
});
618+
let schema = PayloadFieldSchema::FieldParams(params);
619+
let index_types = schema_capacities(&schema);
620+
assert!(index_types.contains(&FieldIndexType::IntMatch));
621+
assert!(index_types.contains(&FieldIndexType::IntRange));
622+
}
623+
}

0 commit comments

Comments
 (0)