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

Function parse_set_with_ex

nodedb/src/control/server/resp/command.rs:82–95  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

80
81 #[test]
82 fn parse_set_with_ex() {
83 let value = RespValue::array(vec![
84 RespValue::bulk_str("SET"),
85 RespValue::bulk_str("key"),
86 RespValue::bulk_str("value"),
87 RespValue::bulk_str("EX"),
88 RespValue::bulk_str("60"),
89 ]);
90 let cmd = RespCommand::parse(&value).unwrap();
91 assert_eq!(cmd.name, "SET");
92 assert_eq!(cmd.argc(), 4);
93 assert_eq!(cmd.arg_str(2), Some("EX"));
94 assert_eq!(cmd.arg_i64(3), Some(60));
95 }
96
97 #[test]
98 fn parse_empty_array_returns_none() {

Callers

nothing calls this directly

Calls 2

arrayFunction · 0.85
parseFunction · 0.50

Tested by

no test coverage detected