Skip to content

Commit f4289da

Browse files
committed
Add test that invalid default component type gives an error
1 parent 6477e74 commit f4289da

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

core/src/types.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,3 +275,20 @@ impl NumValue for u64 {}
275275
impl NumValue for u32 {}
276276
impl NumValue for u16 {}
277277
impl NumValue for u8 {}
278+
279+
#[cfg(test)]
280+
mod tests {
281+
use std::str::FromStr;
282+
283+
use crate::{errors::GraphAnnisCoreError, types::DefaultComponentType};
284+
285+
#[test]
286+
fn parse_invalid_component_type() {
287+
let result = DefaultComponentType::from_str("doesnotexist");
288+
assert!(result.is_err());
289+
assert!(matches!(
290+
result.unwrap_err(),
291+
GraphAnnisCoreError::InvalidComponentType(_)
292+
));
293+
}
294+
}

0 commit comments

Comments
 (0)