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

Function test_extract_struct

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

Source from the content-addressed store, hash-verified

892
893 #[test]
894 fn test_extract_struct() {
895 let mut parser = CppParser::new();
896 let source = r#"
897struct Point {
898 double x;
899 double y;
900};
901"#;
902 let entities = parser.extract(source, "point.cpp");
903 let point = entities.iter().find(|e| e.name == "Point").unwrap();
904 assert_eq!(point.kind, EntityKind::Class);
905 assert!(
906 point.signature.as_ref().unwrap().contains("struct Point"),
907 "Signature: {:?}",
908 point.signature
909 );
910 }
911
912 #[test]
913 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