| 863 | |
| 864 | #[test] |
| 865 | fn test_extract_const() { |
| 866 | let mut parser = RustParser::new(); |
| 867 | let source = r#" |
| 868 | pub const MAX_RETRIES: u32 = 3; |
| 869 | const INTERNAL_LIMIT: usize = 100; |
| 870 | "#; |
| 871 | let entities = parser.extract(source, "src/config.rs"); |
| 872 | |
| 873 | let max = entities.iter().find(|e| e.name == "MAX_RETRIES"); |
| 874 | assert!(max.is_some(), "Should find MAX_RETRIES"); |
| 875 | assert_eq!(max.unwrap().kind, EntityKind::Const); |
| 876 | assert!(max.unwrap().exported); |
| 877 | |
| 878 | let internal = entities.iter().find(|e| e.name == "INTERNAL_LIMIT"); |
| 879 | assert!(internal.is_some(), "Should find INTERNAL_LIMIT"); |
| 880 | assert!(!internal.unwrap().exported); |
| 881 | } |
| 882 | |
| 883 | #[test] |
| 884 | fn test_extract_static() { |