Пример #1
0
 def test_consecutive(self, haystack):
     assert list(match_consecutive(['bar', 'baz'],
                                   haystack)) == [self.entry1]
     assert list(match_consecutive(['foo', 'bar'],
                                   haystack)) == [self.entry2]
     assert list(match_consecutive(['国', 'guo'], haystack)) == [self.entry4]
     assert list(match_consecutive(['bar', 'foo'], haystack)) == []
Пример #2
0
 def test_single_needle(self, haystack):
     assert list(match_consecutive(['baz'],
                                   haystack)) == [self.entry1, self.entry3]
     assert list(match_consecutive(['本'], haystack)) == [self.entry5]
Пример #3
0
 def test_wildcard_in_needle(self, haystack):
     assert list(match_consecutive(['*', 'this'], haystack)) == []
     assert list(match_consecutive(['*', 'edge', 'case'],
                                   haystack)) == [self.entry6]
Пример #4
0
 def test_thing(self, windows_haystack):
     assert list(match_consecutive(['win', '32'], windows_haystack, True)) \
         == [self.win_entry3]
Пример #5
0
 def test_foo_bar_baz(self, windows_haystack):
     assert list(match_consecutive(['bar', 'baz'], windows_haystack, ignore_case=True)) \
         == [self.win_entry1]
Пример #6
0
 def test_backslashes_for_windows_paths(self, windows_haystack):
     assert list(match_consecutive(['program', 'gimp'], windows_haystack, True)) \
         == [self.win_entry2]
Пример #7
0
 def test_windows_ignore_case(self, windows_haystack):
     assert list(match_consecutive(['gimp'], windows_haystack,
                                   True)) == [self.win_entry2]
Пример #8
0
 def test_ignore_case(self, haystack):
     assert list(match_consecutive(['FoO', 'bAR'], haystack, ignore_case=True)) \
         == [self.entry2]
Пример #9
0
 def test_consecutive(self, haystack):
     assert list(match_consecutive(['bar', 'baz'], haystack)) == [self.entry1]
     assert list(match_consecutive(['foo', 'bar'], haystack)) == [self.entry2]
     assert list(match_consecutive(['国', 'guo'], haystack)) == [self.entry4]
     assert list(match_consecutive(['bar', 'foo'], haystack)) == []
Пример #10
0
 def test_wildcard_in_needle(self, haystack):
     assert list(match_consecutive(['*', 'this'], haystack)) == []
     assert list(match_consecutive(['*', 'edge', 'case'], haystack)) == [self.entry6]
Пример #11
0
 def test_single_needle(self, haystack):
     assert list(match_consecutive(['baz'], haystack)) == [self.entry1, self.entry3]
     assert list(match_consecutive(['本'], haystack)) == [self.entry5]
Пример #12
0
 def test_thing(self, windows_haystack):
     assert list(match_consecutive(['win', '32'], windows_haystack, True)) \
         == [self.win_entry3]
Пример #13
0
 def test_foo_bar_baz(self, windows_haystack):
     assert list(match_consecutive(['bar', 'baz'], windows_haystack, ignore_case=True)) \
         == [self.win_entry1]
Пример #14
0
 def test_backslashes_for_windows_paths(self, windows_haystack):
     assert list(match_consecutive(['program', 'gimp'], windows_haystack, True)) \
         == [self.win_entry2]
Пример #15
0
 def test_windows_ignore_case(self, windows_haystack):
     assert list(match_consecutive(['gimp'], windows_haystack, True)) == [self.win_entry2]
Пример #16
0
 def test_ignore_case(self, haystack):
     assert list(match_consecutive(['FoO', 'bAR'], haystack, ignore_case=True)) \
         == [self.entry2]