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

Function test_extract_trait

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

Source from the content-addressed store, hash-verified

732
733 #[test]
734 fn test_extract_trait() {
735 let mut parser = RustParser::new();
736 let source = r#"
737pub trait Repository {
738 fn find(&self, id: &str) -> Option<Entity>;
739 fn save(&mut self, entity: &Entity) -> Result<(), Error>;
740}
741"#;
742 let entities = parser.extract(source, "src/traits.rs");
743 let repo = entities.iter().find(|e| e.name == "Repository").unwrap();
744 assert_eq!(repo.kind, EntityKind::Interface);
745 assert!(repo.exported);
746 }
747
748 #[test]
749 fn test_extract_trait_methods() {

Callers

nothing calls this directly

Calls 3

extractMethod · 0.45
unwrapMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected