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

Function test_extract_imports

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

Source from the content-addressed store, hash-verified

876
877 #[test]
878 fn test_extract_imports() {
879 let mut parser = JavaParser::new();
880 let source = r#"
881import java.util.List;
882import java.util.Map;
883import static java.lang.Math.PI;
884
885public class App {}
886"#;
887 let entities = parser.extract(source, "App.java");
888
889 let imports: Vec<_> = entities
890 .iter()
891 .filter(|e| e.kind == EntityKind::Import)
892 .collect();
893 assert!(
894 imports.len() >= 3,
895 "Should find 3 imports, got: {:?}",
896 imports.iter().map(|e| &e.name).collect::<Vec<_>>()
897 );
898
899 assert!(
900 imports.iter().any(|e| e.name.contains("java.util.List")),
901 "Should find java.util.List import"
902 );
903 }
904
905 #[test]
906 fn test_extract_abstract_class() {

Callers

nothing calls this directly

Calls 2

extractMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected