示例#1
0
 def test_find_6 (self, _, builder):
     tree = Tree ({
         'A' : 'a',
         'B' : 'ab',
         'C' : 'abc',
         'D' : 'abcd',
         'E' : 'abcde',
     }, builder = builder)
     self.assertEqual (len (tree.find_all ('abcde')), 1)
     self.assertEqual (len (tree.find_all ('abcd')),  2)
     self.assertEqual (len (tree.find_all ('abc')),   3)
     self.assertEqual (len (tree.find_all ('ab')),    4)
     self.assertEqual (len (tree.find_all ('a')),     5)
示例#2
0
 def test_find_7 (self, _, builder):
     tree = Tree ({
         'A' : 'abcde',
         'B' : 'bcde',
         'C' : 'cde',
         'D' : 'de',
         'E' : 'e',
     }, builder = builder)
     self.assertEqual (len (tree.find_all ('abcde')), 1)
     self.assertEqual (len (tree.find_all ('bcde')),  2)
     self.assertEqual (len (tree.find_all ('cde')),   3)
     self.assertEqual (len (tree.find_all ('de')),    4)
     self.assertEqual (len (tree.find_all ('e')),     5)
示例#3
0
 def test_find_5 (self, _, builder):
     tree = Tree ({
         'A' : 'aaaaa',
         'B' : 'bbbb',
     }, builder = builder)
     self.assertEqual (len (tree.find_all ('a')), 5)
     self.assertEqual (len (tree.find_all ('b')), 4)