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

Function test_static_method

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

Source from the content-addressed store, hash-verified

1191
1192 #[test]
1193 fn test_static_method() {
1194 let mut parser = JavaParser::new();
1195 let source = r#"
1196public class MathUtils {
1197 public static int add(int a, int b) {
1198 return a + b;
1199 }
1200}
1201"#;
1202 let entities = parser.extract(source, "MathUtils.java");
1203 let add = entities.iter().find(|e| e.name == "add").unwrap();
1204 assert!(
1205 add.signature.as_ref().unwrap().contains("static"),
1206 "Should contain static in signature: {:?}",
1207 add.signature
1208 );
1209 }
1210
1211 #[test]
1212 fn test_multiple_classes_in_file() {

Callers

nothing calls this directly

Calls 3

extractMethod · 0.45
unwrapMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected