Implement map key exists in mgp (#1336)

This commit is contained in:
Matija Pintarić
2023-10-23 15:29:41 +02:00
committed by GitHub
parent aec4c3dd2b
commit 97ed912ab6
5 changed files with 31 additions and 0 deletions

View File

@@ -758,3 +758,12 @@ TYPED_TEST(CppApiTestFixture, TestInAndOutDegrees) {
ASSERT_EQ(node_2.OutDegree(), 0);
ASSERT_EQ(node_3.OutDegree(), 0);
}
TYPED_TEST(CppApiTestFixture, TestMapKeyExist) {
mgp::Map map = mgp::Map();
map.Insert("key", mgp::Value("string"));
ASSERT_EQ(true, map.KeyExists("key"));
ASSERT_EQ(false, map.KeyExists("no_existo"));
map.Insert("null_key", mgp::Value());
ASSERT_EQ(true, map.KeyExists("null_key"));
}