Skip to content

Commit

Permalink
Fix build of unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gibber9809 committed Dec 5, 2024
1 parent f3be5df commit 7871210
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions components/core/tests/test-kql.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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()));
Expand Down Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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") {
Expand Down

0 comments on commit 7871210

Please sign in to comment.