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

Function test_nested_namespace

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

Source from the content-addressed store, hash-verified

1132
1133 #[test]
1134 fn test_nested_namespace() {
1135 let mut parser = CppParser::new();
1136 let source = r#"
1137namespace outer {
1138 namespace inner {
1139 void deep_func() {}
1140 }
1141}
1142"#;
1143 let entities = parser.extract(source, "nested.cpp");
1144
1145 let outer = entities.iter().find(|e| e.name == "outer").unwrap();
1146 assert_eq!(outer.kind, EntityKind::Module);
1147
1148 let inner = entities.iter().find(|e| e.name == "outer::inner").unwrap();
1149 assert_eq!(inner.kind, EntityKind::Module);
1150
1151 let func = entities
1152 .iter()
1153 .find(|e| e.name == "outer::inner::deep_func")
1154 .unwrap();
1155 assert_eq!(func.kind, EntityKind::Function);
1156 }
1157
1158 #[test]
1159 fn test_template_class() {

Callers

nothing calls this directly

Calls 3

extractMethod · 0.45
unwrapMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected