| 886 | |
| 887 | #[test] |
| 888 | fn test_extract_const() { |
| 889 | let mut parser = RustParser::new(); |
| 890 | let source = r#" |
| 891 | pub const MAX_RETRIES: u32 = 3; |
| 892 | const INTERNAL_LIMIT: usize = 100; |
| 893 | "#; |
| 894 | let entities = parser.extract(source, "src/config.rs"); |
| 895 | |
| 896 | let max = entities.iter().find(|e| e.name == "MAX_RETRIES"); |
| 897 | assert!(max.is_some(), "Should find MAX_RETRIES"); |
| 898 | assert_eq!(max.unwrap().kind, EntityKind::Const); |
| 899 | assert!(max.unwrap().exported); |
| 900 | |
| 901 | let internal = entities.iter().find(|e| e.name == "INTERNAL_LIMIT"); |
| 902 | assert!(internal.is_some(), "Should find INTERNAL_LIMIT"); |
| 903 | assert!(!internal.unwrap().exported); |
| 904 | } |
| 905 | |
| 906 | #[test] |
| 907 | fn test_extract_static() { |