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

Function test_extract_constructor

atomic-semantic/src/parsers/java.rs:763–787  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

761
762 #[test]
763 fn test_extract_constructor() {
764 let mut parser = JavaParser::new();
765 let source = r#"
766public class User {
767 public User(String name, int age) {
768 }
769}
770"#;
771 let entities = parser.extract(source, "User.java");
772
773 let constructor = entities
774 .iter()
775 .find(|e| e.name == "User" && e.kind == EntityKind::Method);
776 assert!(constructor.is_some(), "Should find User constructor");
777 assert!(
778 constructor
779 .unwrap()
780 .signature
781 .as_ref()
782 .unwrap()
783 .contains("(String name, int age)"),
784 "Constructor signature: {:?}",
785 constructor.unwrap().signature
786 );
787 }
788
789 #[test]
790 fn test_extract_interface() {

Callers

nothing calls this directly

Calls 2

extractMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected