diff --git a/components/core/tests/test-kql.cpp b/components/core/tests/test-kql.cpp index 2646ff5e0..9eebc8f05 100644 --- a/components/core/tests/test-kql.cpp +++ b/components/core/tests/test-kql.cpp @@ -65,7 +65,8 @@ TEST_CASE("Test parsing KQL", "[KQL]") { REQUIRE(false == filter->is_inverted()); REQUIRE(FilterOperation::EQ == filter->get_operation()); REQUIRE(1 == filter->get_column()->get_descriptor_list().size()); - REQUIRE(DescriptorToken{"key"} == *filter->get_column()->descriptor_begin()); + auto const key_token = DescriptorToken::create_descriptor_from_escaped_token("key"); + REQUIRE(key_token == *filter->get_column()->descriptor_begin()); std::string extracted_value; REQUIRE(filter->get_operand()->as_var_string(extracted_value, filter->get_operation())); REQUIRE("value" == extracted_value); @@ -82,7 +83,8 @@ TEST_CASE("Test parsing KQL", "[KQL]") { REQUIRE(true == not_filter->is_inverted()); REQUIRE(FilterOperation::EQ == not_filter->get_operation()); REQUIRE(1 == not_filter->get_column()->get_descriptor_list().size()); - REQUIRE(DescriptorToken{"key"} == *not_filter->get_column()->descriptor_begin()); + auto const key_token = DescriptorToken::create_descriptor_from_escaped_token("key"); + REQUIRE(key_token == *not_filter->get_column()->descriptor_begin()); std::string extracted_value; REQUIRE(not_filter->get_operand() ->as_var_string(extracted_value, not_filter->get_operation())); @@ -127,7 +129,8 @@ TEST_CASE("Test parsing KQL", "[KQL]") { std::string key = "key" + std::to_string(suffix_number); std::string value = "value" + std::to_string(suffix_number); REQUIRE(value == extracted_value); - REQUIRE(DescriptorToken{key} == *filter->get_column()->descriptor_begin()); + auto const key_token = DescriptorToken::create_descriptor_from_escaped_token(key); + REQUIRE(key_token == *filter->get_column()->descriptor_begin()); ++suffix_number; } } @@ -176,7 +179,8 @@ TEST_CASE("Test parsing KQL", "[KQL]") { std::string key = "key" + std::to_string(suffix_number); std::string value = "value" + std::to_string(suffix_number); REQUIRE(value == extracted_value); - REQUIRE(DescriptorToken{key} == *filter->get_column()->descriptor_begin()); + auto const key_token = DescriptorToken::create_descriptor_from_escaped_token(key); + REQUIRE(key_token == *filter->get_column()->descriptor_begin()); ++suffix_number; } } @@ -206,8 +210,10 @@ TEST_CASE("Test parsing KQL", "[KQL]") { REQUIRE(FilterOperation::EQ == filter->get_operation()); REQUIRE(2 == filter->get_column()->get_descriptor_list().size()); auto it = filter->get_column()->descriptor_begin(); - REQUIRE(DescriptorToken{"a.b"} == *it++); - REQUIRE(DescriptorToken{"c"} == *it++); + auto const a_b_token = DescriptorToken::create_descriptor_from_escaped_token("a.b"); + REQUIRE(a_b_token == *it++); + auto const c_token = DescriptorToken::create_descriptor_from_escaped_token("c"); + REQUIRE(c_token == *it++); } SECTION("Illegal escape sequences in column name") {