MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / test_extract_generic_struct

Function test_extract_generic_struct

atomic-semantic/src/parsers/rust.rs:700–715  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

698
699 #[test]
700 fn test_extract_generic_struct() {
701 let mut parser = RustParser::new();
702 let source = r#"
703pub struct Cache<K, V> {
704 entries: HashMap<K, V>,
705 capacity: usize,
706}
707"#;
708 let entities = parser.extract(source, "src/cache.rs");
709 let cache = entities.iter().find(|e| e.name == "Cache").unwrap();
710 assert!(
711 cache.signature.as_ref().unwrap().contains("<K, V>"),
712 "Should include generics: {:?}",
713 cache.signature
714 );
715 }
716
717 #[test]
718 fn test_extract_enum() {

Callers

nothing calls this directly

Calls 3

extractMethod · 0.45
unwrapMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected