예제 #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]