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

Function test_extract_generic_struct

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

Source from the content-addressed store, hash-verified

721
722 #[test]
723 fn test_extract_generic_struct() {
724 let mut parser = RustParser::new();
725 let source = r#"
726pub struct Cache<K, V> {
727 entries: HashMap<K, V>,
728 capacity: usize,
729}
730"#;
731 let entities = parser.extract(source, "src/cache.rs");
732 let cache = entities.iter().find(|e| e.name == "Cache").unwrap();
733 assert!(
734 cache.signature.as_ref().unwrap().contains("<K, V>"),
735 "Should include generics: {:?}",
736 cache.signature
737 );
738 }
739
740 #[test]
741 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