コード例 #1
0
 def test_subpatterns(self):
     tokens = parse("^(?:asdf|fdsa$)")
     self.assertTrue(search_regex_tokens(self.end_tokens, tokens))
コード例 #2
0
 def test_backwards(self):
     tokens = parse("^asdf$")
     self.assertTrue(
         search_regex_tokens(self.end_tokens, tokens, backwards=True))
コード例 #3
0
 def test_branches(self):
     tokens = parse("^asdf|fdsa$")
     self.assertTrue(search_regex_tokens(self.end_tokens, tokens))
コード例 #4
0
 def test_no_ending_tokens(self):
     tokens = parse("^asdf")
     self.assertFalse(search_regex_tokens(self.end_tokens, tokens))
コード例 #5
0
 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))
コード例 #6
0
 def test_subpatterns(self):
     tokens = parse("^(?:asdf|fdsa$)")
     self.assertTrue(search_regex_tokens(self.end_tokens, tokens))
コード例 #7
0
 def test_beginning_tokens(self):
     tokens = parse("^asdf")
     self.assertTrue(search_regex_tokens(self.beginning_tokens, tokens))
コード例 #8
0
 def test_branches(self):
     tokens = parse("^asdf|fdsa$")
     self.assertTrue(search_regex_tokens(self.end_tokens, tokens))
コード例 #9
0
 def test_backwards(self):
     tokens = parse("^asdf$")
     self.assertTrue(search_regex_tokens(self.end_tokens, tokens, backwards=True))
コード例 #10
0
 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))
コード例 #11
0
 def test_no_ending_tokens(self):
     tokens = parse("^asdf")
     self.assertFalse(search_regex_tokens(self.end_tokens, tokens))
コード例 #12
0
 def test_beginning_tokens(self):
     tokens = parse("^asdf")
     self.assertTrue(search_regex_tokens(self.beginning_tokens, tokens))