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

Function test_extract_inline_method

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

Source from the content-addressed store, hash-verified

1035
1036 #[test]
1037 fn test_extract_inline_method() {
1038 let mut parser = CppParser::new();
1039 let source = r#"
1040class Calculator {
1041public:
1042 int add(int a, int b) {
1043 return a + b;
1044 }
1045};
1046"#;
1047 let entities = parser.extract(source, "calc.cpp");
1048
1049 let calc = entities.iter().find(|e| e.name == "Calculator").unwrap();
1050 assert_eq!(calc.kind, EntityKind::Class);
1051
1052 let add = entities
1053 .iter()
1054 .find(|e| e.name == "Calculator::add")
1055 .unwrap();
1056 assert_eq!(add.kind, EntityKind::Method);
1057 }
1058
1059 #[test]
1060 fn test_extract_type_alias() {

Callers

nothing calls this directly

Calls 3

extractMethod · 0.45
unwrapMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected