| 895 | |
| 896 | #[test] |
| 897 | fn test_extract_mod() { |
| 898 | let mut parser = RustParser::new(); |
| 899 | let source = r#" |
| 900 | pub mod auth; |
| 901 | mod internal; |
| 902 | pub 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() { |