示例#1
0
 def test_simplist_expression(self):
     self.assertEqual([['name', 'A'], ['name']],
                      p('name:"A" > name'))
     self.assertEqual([['name', 'A'], ['name']],
                      p('name:"A"'))
     self.assertEqual([['name', 'A'], ['name']],
                      p('"A"'))
示例#2
0
 def test_logical_expression(self):
     self.assertEqual([[['name', 'A'], '*', ['name', 'B']], ['name']],
                      p('"A" * "B"'))
     self.assertEqual([[['name', 'A'], '+', ['name', 'B']], ['name']],
                      p('"A" + "B"'))
     self.assertEqual([[['name', 'A'], '+', [['name', 'B'], '*', ['name', 'C']]], ['name']],
                      p('"A" + "B" * "C"'))
     self.assertEqual([[[['name', 'A'], '+', ['name', 'B']], '*', ['name', 'C']], ['name']],
                      p('("A" + "B") * "C"'))
示例#3
0
 def test_attr_expression(self):
     self.assertEqual((['name', 'A'], ['name', 'author'], []),
                      p('name:"A" > name, author'))
示例#4
0
 def test_attr_expression(self):
     self.assertEqual([['name', 'A'], ['name', 'author']],
                      p('name:"A" > name, author'))