|  | 
| 1 | 1 | import re | 
| 2 |  | -from string import ascii_letters, punctuation | 
| 3 |  | - | 
| 4 |  | -from hypothesis import example, given | 
| 5 |  | -from hypothesis.strategies import lists, text | 
| 6 | 2 | 
 | 
| 7 | 3 | from trrex import make | 
| 8 | 4 | 
 | 
| @@ -66,25 +62,3 @@ def test_findall_emoticon(): | 
| 66 | 62 |     emoticons = [":)", ":D", ":("] | 
| 67 | 63 |     pattern = compile(emoticons, left=r"(?<!\w)", right=r"(?!\w)") | 
| 68 | 64 |     assert pattern.findall("The smile :), and the laugh :D and the sad :(") == emoticons | 
| 69 |  | - | 
| 70 |  | - | 
| 71 |  | -@given(text(alphabet=ascii_letters, min_size=1)) | 
| 72 |  | -def test_single_string_match(s): | 
| 73 |  | -    pattern = compile([s]) | 
| 74 |  | -    assert pattern.match(s) is not None | 
| 75 |  | - | 
| 76 |  | - | 
| 77 |  | -@example(lst=["B", "BA", "B"]) | 
| 78 |  | -@given(lists(text(alphabet=ascii_letters, min_size=1))) | 
| 79 |  | -def test_multiple_string_match(lst): | 
| 80 |  | -    pattern = compile(lst) | 
| 81 |  | -    for word in lst: | 
| 82 |  | -        assert pattern.match(word) is not None | 
| 83 |  | - | 
| 84 |  | - | 
| 85 |  | -@given(lists(text(alphabet=ascii_letters + punctuation, min_size=1))) | 
| 86 |  | -def test_multiple_string_match_punctuation(lst): | 
| 87 |  | -    words = [tuple(map(re.escape, word)) for word in lst] | 
| 88 |  | -    pattern = compile(words, left="", right="") | 
| 89 |  | -    for word in lst: | 
| 90 |  | -        assert pattern.match(word) is not None | 
0 commit comments