()
| 1329 | |
| 1330 | #[test] |
| 1331 | fn test_c_function() { |
| 1332 | let mut parser = CppParser::new_c(); |
| 1333 | let source = r#" |
| 1334 | int 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() { |