def test_glob(self): self.assertIs(match('foo', 'glob:f*'), True) self.assertIs(match('foo', 'glob:fo?'), True) self.assertIs(match('foo', 'glob:'), False) self.assertIs(match('foo', 'glob:b*'), False) self.assertIs(match('foo', 'glob:?ar'), False)
def test_multiline_strings(self): self.assertIs(match('foo\nbar', 'glob:foo*'), True) self.assertIs(match('foo\nbar', 'regex:^foo.*$'), True)
def test_regexp(self): self.assertIs(match('foo', 'regexp:^fo+$'), True) self.assertIs(match('foo', 'regexp:^f+$'), False)
def test_glob_with_regex_chars_should_work(self): self.assertIs(match('(foo)', 'glob:(foo)'), True) self.assertIs(match('[foo]', 'glob:[foo]'), True)
def test_exact(self): self.assertIs(match('foo', 'exact:foo'), True) self.assertIs(match('foo', 'exact:bar'), False)
def test_no_prefix(self): self.assertIs(match('foo', 'foo'), True) self.assertIs(match('foo', 'bar'), False) self.assertIs(match('foo:bar', 'foo:bar'), True)