reapack

Package manager for REAPER
Log | Files | Refs | Submodules | README | LICENSE

commit 9290619e9feba882f0601e79c6b2a732f9a85e41
parent d5ba3d78e265548c23843ba5cafde2bda748db78
Author: cfillion <cfillion@users.noreply.github.com>
Date:   Sun, 26 Jan 2020 22:45:19 -0500

filter: add tests for literal operators

Diffstat:
Mtest/filter.cpp | 27+++++++++++++++++++--------
1 file changed, 19 insertions(+), 8 deletions(-)

diff --git a/test/filter.cpp b/test/filter.cpp @@ -214,13 +214,6 @@ TEST_CASE("OR operator", M) { REQUIRE(f.match({"bacon"})); } - SECTION("quoted") { - f.set("hello 'OR' bacon"); - - REQUIRE_FALSE(f.match({"hello world"})); - REQUIRE(f.match({"hello OR bacon"})); - } - SECTION("reset") { f.set("hello OR bacon world"); @@ -233,6 +226,12 @@ TEST_CASE("OR operator", M) { f.set("OR"); REQUIRE(f.match({"anything"})); } + + SECTION("literal OR") { + f.set("'OR'"); + REQUIRE(f.match({"OR"})); + REQUIRE_FALSE(f.match({"foo"})); + } } TEST_CASE("NOT operator", M) { @@ -265,7 +264,7 @@ TEST_CASE("NOT operator", M) { REQUIRE(f.match({"hello", "bacon"})); } - SECTION("quote word matching") { + SECTION("full word matching") { f.set("NOT 'hello'"); REQUIRE(f.match({"hellobacon"})); } @@ -275,6 +274,12 @@ TEST_CASE("NOT operator", M) { REQUIRE(f.match({"hello"})); REQUIRE_FALSE(f.match({"world"})); } + + SECTION("literal NOT") { + f.set("'NOT'"); + REQUIRE(f.match({"NOT"})); + REQUIRE_FALSE(f.match({"foo"})); + } } TEST_CASE("AND grouping", M) { @@ -320,4 +325,10 @@ TEST_CASE("AND grouping", M) { REQUIRE_FALSE(f.match({"apple bacon"})); REQUIRE_FALSE(f.match({"bacon"})); } + + SECTION("literal parentheses") { + f.set("'('"); + REQUIRE(f.match({"("})); + REQUIRE_FALSE(f.match({"foo"})); + } }