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

Function parse_multiple_commands

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

Source from the content-addressed store, hash-verified

438
439 #[test]
440 fn parse_multiple_commands() {
441 let mut parser = RespParser::new();
442 parser.feed(b"*1\r\n$4\r\nPING\r\n*2\r\n$3\r\nGET\r\n$1\r\na\r\n");
443
444 let first = parser.try_parse().unwrap().unwrap();
445 assert!(matches!(first, RespValue::Array(Some(ref v)) if v.len() == 1));
446
447 let second = parser.try_parse().unwrap().unwrap();
448 assert!(matches!(second, RespValue::Array(Some(ref v)) if v.len() == 2));
449 }
450
451 #[test]
452 fn roundtrip() {

Callers

nothing calls this directly

Calls 2

try_parseMethod · 0.80
feedMethod · 0.45

Tested by

no test coverage detected