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

Function test_c_function

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

Source from the content-addressed store, hash-verified

1329
1330 #[test]
1331 fn test_c_function() {
1332 let mut parser = CppParser::new_c();
1333 let source = r#"
1334int add(int a, int b) {
1335 return a + b;
1336}
1337"#;
1338 let entities = parser.extract(source, "math.c");
1339 let add = entities.iter().find(|e| e.name == "add").unwrap();
1340 assert_eq!(add.kind, EntityKind::Function);
1341 }
1342
1343 #[test]
1344 fn test_c_struct() {

Callers

nothing calls this directly

Calls 3

extractMethod · 0.45
unwrapMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected