torwig commented on code in PR #1856:
URL: https://github.com/apache/kvrocks/pull/1856#discussion_r1372617445
##########
tests/cppunit/types/json_test.cc:
##########
@@ -262,7 +262,9 @@ TEST_F(RedisJsonTest, ArrLen) {
ASSERT_EQ(res.size(), 1);
ASSERT_EQ(res[0], 3);
res.clear();
- // 5. path is not found
+ // 5. key/path is not found
+ ASSERT_FALSE(json_->ArrLen("not_exists", "$.*", res).ok());
+ ASSERT_TRUE(res.empty());
Review Comment:
I saw that many functions through the codebase explicitly clear the output
parameter at the beginning of the function. Can we do that inside
Json::ArrLen()? I mean, call `arr_lens->clear()`. What do you think, @mapleFU
@PragmaTwice ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]