Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding support for fuzzy list comparison #1426

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 23 additions & 20 deletions tests/filterparser/test_filterparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,23 +272,26 @@ class TestParserV1_2_0(TestParserV1_0_0):
version = (1, 2, 0)
variant = "develop"

def test_boolean_values(self):
assert isinstance(
self.parse("_exmpl_element_counts = TRUE"),
Tree,
)

assert isinstance(
self.parse("_exmpl_element_counts = FALSE"),
Tree,
)

assert isinstance(
self.parse("_exmpl_element_counts != FALSE"),
Tree,
)

assert isinstance(
self.parse("NOT _exmpl_element_counts = TRUE"),
Tree,
)
@pytest.mark.parametrize(
"case",
[
"_exmpl_element_counts = TRUE",
"_exmpl_element_counts = FALSE",
"_exmpl_element_counts != FALSE",
"_exmpl_element_counts != FALSE",
"NOT _exmpl_element_counts = TRUE",
],
)
def test_good_boolean_value_queries(self, case):
assert isinstance(self.parse(case), Tree)

@pytest.mark.parametrize(
"case",
[
'name:surname HAS STARTS WITH "J":CONTAINS "Doe"',
'title HAS ENDS WITH "MOF"',
'elements HAS ALL STARTS WITH "S"',
],
)
def test_fuzzy_list_comparisons(self, case):
assert isinstance(self.parse(case), Tree)