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

Function test_extract_struct

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

Source from the content-addressed store, hash-verified

869
870 #[test]
871 fn test_extract_struct() {
872 let mut parser = CppParser::new();
873 let source = r#"
874struct Point {
875 double x;
876 double y;
877};
878"#;
879 let entities = parser.extract(source, "point.cpp");
880 let point = entities.iter().find(|e| e.name == "Point").unwrap();
881 assert_eq!(point.kind, EntityKind::Class);
882 assert!(
883 point.signature.as_ref().unwrap().contains("struct Point"),
884 "Signature: {:?}",
885 point.signature
886 );
887 }
888
889 #[test]
890 fn test_extract_namespace() {

Callers

nothing calls this directly

Calls 3

extractMethod · 0.45
unwrapMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected