Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
jedelbo committed Jan 25, 2024
1 parent 68fd450 commit 35f4a8d
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions test/test_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4867,19 +4867,19 @@ TEST(Parser_TypeOfValue)
verify_query(test_context, table,
"mixed.@type == 'binary' || mixed.@type == 'DECIMAL' || mixed.@type == 'Double'", 4);
verify_query(test_context, table, "mixed.@type == 'null'", 1);
verify_query(test_context, table, "mixed.@type == 'numeric'", table->size() - nb_strings - 2);
verify_query(
test_context, table,
"mixed.@type == 'numeric' || mixed.@type == 'string' || mixed.@type == 'binary' || mixed.@type == 'null'",
table->size());
verify_query(test_context, table, "mixed.@type == 'numeric'", table->size() - nb_strings - 3);
verify_query(test_context, table,
"mixed.@type == 'numeric' || mixed.@type == 'string' || mixed.@type == 'binary' || mixed.@type == "
"'object' || mixed.@type == 'null'",
table->size());
verify_query(test_context, table, "mixed.@type == mixed.@type", table->size());
verify_query(test_context, origin, "link.mixed.@type == 'numeric' || link.mixed.@type == 'string'",
origin->size());
verify_query(test_context, origin, "links.mixed.@type == 'numeric' || links.mixed.@type == 'string'",
origin->size());
verify_query(test_context, origin, "ANY links.mixed.@type IN ANY {'numeric', 'string'}", origin->size());

verify_query(test_context, table, "mixed.@type == int.@type", table->size() - nb_strings - 5);
verify_query(test_context, table, "mixed.@type == int.@type", nb_ints);
verify_query(test_context, origin, "link.@type == link.mixed.@type", 0);
verify_query(test_context, origin, "links.@type == links.mixed.@type", 0);

Expand Down Expand Up @@ -4935,10 +4935,11 @@ TEST(Parser_TypeOfValue)
CHECK_THROW_EX(verify_query(test_context, table, "int.@type == 'int'", 1), query_parser::InvalidQueryError,
std::string(e.what()).find("Comparison between two constants is not supported") !=
std::string::npos);
CHECK_THROW_EX(verify_query(test_context, origin, "link.@type == 'object'", 1), query_parser::InvalidQueryError,
CHECK(std::string(e.what()).find(
"Comparison between two constants is not supported ('\"object\"' and '\"object\"')") !=
std::string::npos));
CHECK_THROW_EX(
verify_query(test_context, origin, "link.@type == 'objectlink'", 1), query_parser::InvalidQueryError,
CHECK(std::string(e.what()).find(
"Comparison between two constants is not supported ('\"objectlink\"' and '\"objectlink\"')") !=
std::string::npos));
CHECK_THROW_EX(verify_query(test_context, table, "mixed.@type =[c] 'string'", 1), query_parser::InvalidQueryError,
CHECK_EQUAL(std::string(e.what()), "Unsupported comparison operator '=[c]' against type '@type', "
"right side must be a string or binary type"));
Expand Down

0 comments on commit 35f4a8d

Please sign in to comment.