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

Function test_extract_mod

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

Source from the content-addressed store, hash-verified

895
896 #[test]
897 fn test_extract_mod() {
898 let mut parser = RustParser::new();
899 let source = r#"
900pub mod auth;
901mod internal;
902pub mod utils {
903 pub fn helper() -> bool { true }
904}
905"#;
906 let entities = parser.extract(source, "src/lib.rs");
907
908 let auth = entities.iter().find(|e| e.name == "auth");
909 assert!(auth.is_some(), "Should find auth module");
910 assert_eq!(auth.unwrap().kind, EntityKind::Module);
911 assert!(auth.unwrap().exported);
912
913 let internal = entities.iter().find(|e| e.name == "internal");
914 assert!(internal.is_some(), "Should find internal module");
915 assert!(!internal.unwrap().exported);
916 }
917
918 #[test]
919 fn test_extract_use() {

Callers

nothing calls this directly

Calls 2

extractMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected