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

Function test_extract_static

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

Source from the content-addressed store, hash-verified

882
883 #[test]
884 fn test_extract_static() {
885 let mut parser = RustParser::new();
886 let source = r#"
887pub 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() {

Callers

nothing calls this directly

Calls 2

extractMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected