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

Function test_extract_trait_methods

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

Source from the content-addressed store, hash-verified

747
748 #[test]
749 fn test_extract_trait_methods() {
750 let mut parser = RustParser::new();
751 let source = r#"
752pub trait Service {
753 fn start(&self);
754 fn stop(&mut self);
755}
756"#;
757 let entities = parser.extract(source, "src/traits.rs");
758 assert!(
759 entities.iter().any(|e| e.name == "Service"),
760 "Should find Service trait, got: {:?}",
761 entities.iter().map(|e| &e.name).collect::<Vec<_>>()
762 );
763 // Trait method signatures may or may not be extracted depending on
764 // tree-sitter's representation (they might be function_signature_item
765 // rather than function_item). At minimum, the trait itself should be found.
766 }
767
768 #[test]
769 fn test_extract_impl_block() {

Callers

nothing calls this directly

Calls 1

extractMethod · 0.45

Tested by

no test coverage detected