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

Function test_extract_define

atomic-semantic/src/parsers/cpp.rs:961–979  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

959
960 #[test]
961 fn test_extract_define() {
962 let mut parser = CppParser::new();
963 let source = r#"
964#define MAX_SIZE 1024
965#define VERSION "1.0"
966"#;
967 let entities = parser.extract(source, "config.h");
968 let max_size = entities.iter().find(|e| e.name == "MAX_SIZE").unwrap();
969 assert_eq!(max_size.kind, EntityKind::Const);
970 assert!(
971 max_size
972 .signature
973 .as_ref()
974 .unwrap()
975 .contains("#define MAX_SIZE"),
976 "Signature: {:?}",
977 max_size.signature
978 );
979 }
980
981 #[test]
982 fn test_extract_method_out_of_line() {

Callers

nothing calls this directly

Calls 3

extractMethod · 0.45
unwrapMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected