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

Function test_extract_define

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

Source from the content-addressed store, hash-verified

982
983 #[test]
984 fn test_extract_define() {
985 let mut parser = CppParser::new();
986 let source = r#"
987#define MAX_SIZE 1024
988#define VERSION "1.0"
989"#;
990 let entities = parser.extract(source, "config.h");
991 let max_size = entities.iter().find(|e| e.name == "MAX_SIZE").unwrap();
992 assert_eq!(max_size.kind, EntityKind::Const);
993 assert!(
994 max_size
995 .signature
996 .as_ref()
997 .unwrap()
998 .contains("#define MAX_SIZE"),
999 "Signature: {:?}",
1000 max_size.signature
1001 );
1002 }
1003
1004 #[test]
1005 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