def test_subpatterns(self): tokens = parse("^(?:asdf|fdsa$)") self.assertTrue(search_regex_tokens(self.end_tokens, tokens))
def test_backwards(self): tokens = parse("^asdf$") self.assertTrue( search_regex_tokens(self.end_tokens, tokens, backwards=True))
def test_branches(self): tokens = parse("^asdf|fdsa$") self.assertTrue(search_regex_tokens(self.end_tokens, tokens))
def test_no_ending_tokens(self): tokens = parse("^asdf") self.assertFalse(search_regex_tokens(self.end_tokens, tokens))
def test_no_beginning_or_ending_tokens(self): tokens = parse("asdf") self.assertFalse(search_regex_tokens(self.beginning_tokens, tokens)) self.assertFalse(search_regex_tokens(self.end_tokens, tokens))
def test_subpatterns(self): tokens = parse("^(?:asdf|fdsa$)") self.assertTrue(search_regex_tokens(self.end_tokens, tokens))
def test_beginning_tokens(self): tokens = parse("^asdf") self.assertTrue(search_regex_tokens(self.beginning_tokens, tokens))
def test_branches(self): tokens = parse("^asdf|fdsa$") self.assertTrue(search_regex_tokens(self.end_tokens, tokens))
def test_backwards(self): tokens = parse("^asdf$") self.assertTrue(search_regex_tokens(self.end_tokens, tokens, backwards=True))
def test_no_beginning_or_ending_tokens(self): tokens = parse("asdf") self.assertFalse(search_regex_tokens(self.beginning_tokens, tokens)) self.assertFalse(search_regex_tokens(self.end_tokens, tokens))
def test_no_ending_tokens(self): tokens = parse("^asdf") self.assertFalse(search_regex_tokens(self.end_tokens, tokens))
def test_beginning_tokens(self): tokens = parse("^asdf") self.assertTrue(search_regex_tokens(self.beginning_tokens, tokens))