From a9bf5d9fd88483363298dbf881a582a80bd32101 Mon Sep 17 00:00:00 2001 From: Ines Montani Date: Wed, 6 Feb 2019 13:40:11 +0100 Subject: [PATCH] Add xfailing test for set value with operator [ci skip] --- spacy/tests/matcher/test_matcher_api.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/spacy/tests/matcher/test_matcher_api.py b/spacy/tests/matcher/test_matcher_api.py index 740c8bb98..9e87359d4 100644 --- a/spacy/tests/matcher/test_matcher_api.py +++ b/spacy/tests/matcher/test_matcher_api.py @@ -205,6 +205,19 @@ def test_matcher_set_value(en_vocab): assert len(matches) == 0 +@pytest.mark.xfail +def test_matcher_set_value_operator(en_vocab): + matcher = Matcher(en_vocab) + pattern = [{"ORTH": {"IN": ["a", "the"]}, "OP": "?"}, {"ORTH": "house"}] + matcher.add("DET_HOUSE", None, pattern) + doc = Doc(en_vocab, words=["In", "a", "house"]) + matches = matcher(doc) + assert len(matches) == 1 + doc = Doc(en_vocab, words=["my", "house"]) + matches = matcher(doc) + assert len(matches) == 1 + + def test_matcher_regex(en_vocab): matcher = Matcher(en_vocab) pattern = [{"ORTH": {"REGEX": r"(?:a|an)"}}]