Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
Add expression filter tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas Wojciechowski committed Feb 28, 2018
1 parent ac3fc78 commit bf13252
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/style/filter.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,13 @@ TEST(Filter, ID) {

ASSERT_FALSE(filter("[\"==\", \"$id\", 1234]", {{ "id", uint64_t(1234) }}));
}

TEST(Filter, Expression) {
ASSERT_TRUE(filter("[\"==\", [\"+\", 1, 1], 2]"));
ASSERT_FALSE(filter("[\"==\", [\"+\", 1, 1], 4]"));
}

TEST(Filter, PropertyExpression) {
ASSERT_TRUE(filter("[\"==\", [\"get\", \"two\"], 2]", {{"two", int64_t(2)}}));
ASSERT_FALSE(filter("[\"==\", [\"get\", \"two\"], 4]", {{"two", int64_t(2)}}));
}

0 comments on commit bf13252

Please sign in to comment.