From 487e020ebe4e00bfa3b9ee96e91e99e8d7500299 Mon Sep 17 00:00:00 2001 From: Ines Montani Date: Tue, 10 Jan 2017 15:57:26 +0100 Subject: [PATCH] Add simple test for surrounding brackets --- spacy/tests/tokenizer/test_urls.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/spacy/tests/tokenizer/test_urls.py b/spacy/tests/tokenizer/test_urls.py index 9dc5bbfab..6f905914d 100644 --- a/spacy/tests/tokenizer/test_urls.py +++ b/spacy/tests/tokenizer/test_urls.py @@ -50,6 +50,15 @@ def test_tokenizer_handles_suffixed_url(tokenizer, url, suffix): assert tokens[1].text == suffix +@pytest.mark.parametrize("url", URLS) +def test_tokenizer_handles_simple_surround_url(tokenizer, url): + tokens = tokenizer("(" + url + ")") + assert len(tokens) == 3 + assert tokens[0].text == "(" + assert tokens[1].text == url + assert tokens[2].text == ")" + + @pytest.mark.parametrize("prefix", PREFIXES) @pytest.mark.parametrize("suffix", SUFFIXES) @pytest.mark.parametrize("url", URLS)