示例#1
0
 def test_repeat2(self):
   #return
   # the code below loops for ever.
   x = LogicVar('x')
   eq_(eval(and_(set_text('123'), repeat, char(x), unify(x, '4'))), True) 
示例#2
0
 def test_and3(self):
   assert_raises(NoSolution, eval, and_(succeed, fail))
示例#3
0
 def test_repeat(self):
   #return
   # the code below loops for ever, after modifie the behaviour of solver.parse_state and terminals.
   x = LogicVar('x')
   eq_(eval(and_(set_text('123'), repeat, char(x), unify(x, '3'))), True)
示例#4
0
 def test_and(self):
   eq_(eval(and_(succeed, succeed)), True)
示例#5
0
 def test_and2(self):
   eq_(eval(and_(prin(1), prin(2))), None)
示例#6
0
文件: testparser.py 项目: chaosim/dao
 def testnullword2(self):
   assert_raises(NoSolution, eval, parse_text(and_(nullword, eoi), 'a')) 
   eq_(eval(parse_text(nullword, '')), True)
示例#7
0
文件: testparser.py 项目: chaosim/dao
 def testnullword3(self):
   rule = and_(char('a'), nullword, char('b'))
   eq_(eval(parse_text(rule, 'ab')), 'b') # passed
   assert_raises(NoSolution, eval, parse_text(rule, 'a b'))
   assert_raises(NoSolution, eval, parse_text(rule, 'a'))
示例#8
0
 def testnullword2(self):
     assert_raises(NoSolution, eval, parse_text(and_(nullword, eoi), 'a'))
     eq_(eval(parse_text(nullword, '')), True)
示例#9
0
 def testnullword3(self):
     rule = and_(char('a'), nullword, char('b'))
     eq_(eval(parse_text(rule, 'ab')), 'b')  # passed
     assert_raises(NoSolution, eval, parse_text(rule, 'a b'))
     assert_raises(NoSolution, eval, parse_text(rule, 'a'))
示例#10
0
 def test_repeat2(self):
     #return
     # the code below loops for ever.
     x = LogicVar('x')
     eq_(eval(and_(set_text('123'), repeat, char(x), unify(x, '4'))), True)
示例#11
0
 def test_repeat(self):
     #return
     # the code below loops for ever, after modifie the behaviour of solver.parse_state and terminals.
     x = LogicVar('x')
     eq_(eval(and_(set_text('123'), repeat, char(x), unify(x, '3'))), True)
示例#12
0
 def test_and3(self):
     assert_raises(NoSolution, eval, and_(succeed, fail))
示例#13
0
 def test_and2(self):
     eq_(eval(and_(prin(1), prin(2))), None)
示例#14
0
 def test_and(self):
     eq_(eval(and_(succeed, succeed)), True)