MCPcopy Create free account
hub / github.com/ZettaScaleLabs/hiroz / test_parse_simple_message

Function test_parse_simple_message

crates/hiroz-codegen/src/parser/msg.rs:78–91  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

76
77 #[test]
78 fn test_parse_simple_message() {
79 let msg_content = "uint8 data\nstring name";
80 let path = PathBuf::from("Simple.msg");
81
82 let msg = parse_msg_string(msg_content, "test_msgs", &path).unwrap();
83
84 assert_eq!(msg.name, "Simple");
85 assert_eq!(msg.package, "test_msgs");
86 assert_eq!(msg.fields.len(), 2);
87 assert_eq!(msg.fields[0].name, "data");
88 assert_eq!(msg.fields[0].field_type.base_type, "uint8");
89 assert_eq!(msg.fields[1].name, "name");
90 assert_eq!(msg.fields[1].field_type.base_type, "string");
91 }
92
93 #[test]
94 fn test_parse_message_with_comments() {

Callers

nothing calls this directly

Calls 1

parse_msg_stringFunction · 0.85

Tested by

no test coverage detected