| 882 | |
| 883 | #[test] |
| 884 | fn test_extract_static() { |
| 885 | let mut parser = RustParser::new(); |
| 886 | let source = r#" |
| 887 | pub static GLOBAL_CONFIG: Lazy<Config> = Lazy::new(|| Config::default()); |
| 888 | "#; |
| 889 | let entities = parser.extract(source, "src/config.rs"); |
| 890 | let config = entities.iter().find(|e| e.name == "GLOBAL_CONFIG"); |
| 891 | assert!(config.is_some(), "Should find GLOBAL_CONFIG"); |
| 892 | assert_eq!(config.unwrap().kind, EntityKind::Variable); |
| 893 | assert!(config.unwrap().exported); |
| 894 | } |
| 895 | |
| 896 | #[test] |
| 897 | fn test_extract_mod() { |