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)) == []
def test_single_needle(self, haystack): assert list(match_consecutive(['baz'], haystack)) == [self.entry1, self.entry3] assert list(match_consecutive(['本'], haystack)) == [self.entry5]
def test_wildcard_in_needle(self, haystack): assert list(match_consecutive(['*', 'this'], haystack)) == [] assert list(match_consecutive(['*', 'edge', 'case'], haystack)) == [self.entry6]
def test_thing(self, windows_haystack): assert list(match_consecutive(['win', '32'], windows_haystack, True)) \ == [self.win_entry3]
def test_foo_bar_baz(self, windows_haystack): assert list(match_consecutive(['bar', 'baz'], windows_haystack, ignore_case=True)) \ == [self.win_entry1]
def test_backslashes_for_windows_paths(self, windows_haystack): assert list(match_consecutive(['program', 'gimp'], windows_haystack, True)) \ == [self.win_entry2]
def test_windows_ignore_case(self, windows_haystack): assert list(match_consecutive(['gimp'], windows_haystack, True)) == [self.win_entry2]
def test_ignore_case(self, haystack): assert list(match_consecutive(['FoO', 'bAR'], haystack, ignore_case=True)) \ == [self.entry2]