def test_backslashes_for_windows_paths(self, windows_haystack): # https://github.com/wting/autojump/issues/281 assert list(match_anywhere(['foo', 'baz'], windows_haystack)) \ == [self.win_entry1] assert list(match_anywhere(['program', 'gimp'], windows_haystack, True)) \ == [self.win_entry2] assert list(match_anywhere(['win', '32'], windows_haystack, True)) \ == [self.win_entry3]
def test_wildcard_in_needle(self, haystack): # https://github.com/wting/autojump/issues/402 assert list(match_anywhere(['*', 'this'], haystack)) == [] assert list(match_anywhere(['this', '*'], haystack)) == [self.entry5]
def test_ignore_case(self, haystack): assert list(match_anywhere(['bAz', 'bAR'], haystack, ignore_case=True)) \ == [self.entry2]
def test_skip(self, haystack): assert list(match_anywhere(['baz', 'bar'], haystack)) == [self.entry2] assert list(match_anywhere(['中', '国'], haystack)) == [self.entry4]
def test_consecutive(self, haystack): assert list(match_anywhere(['foo', 'bar'], haystack)) \ == [self.entry1, self.entry2] assert list(match_anywhere(['bar', 'foo'], haystack)) == []
def test_single_needle(self, haystack): assert list(match_anywhere(['bar'], haystack)) == [self.entry1, self.entry2]