MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / parse_bulk_string_array

Function parse_bulk_string_array

nodedb/src/control/server/resp/codec.rs:374–387  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

372
373 #[test]
374 fn parse_bulk_string_array() {
375 let mut parser = RespParser::new();
376 parser.feed(b"*2\r\n$3\r\nGET\r\n$5\r\nmykey\r\n");
377
378 let result = parser.try_parse().unwrap().unwrap();
379 match result {
380 RespValue::Array(Some(items)) => {
381 assert_eq!(items.len(), 2);
382 assert_eq!(items[0], RespValue::bulk(b"GET".to_vec()));
383 assert_eq!(items[1], RespValue::bulk(b"mykey".to_vec()));
384 }
385 other => panic!("expected array, got {other:?}"),
386 }
387 }
388
389 #[test]
390 fn parse_inline_command() {

Callers

nothing calls this directly

Calls 2

try_parseMethod · 0.80
feedMethod · 0.45

Tested by

no test coverage detected