예제 #1
0
파일: testbuiltin.py 프로젝트: chaosim/dao
 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
파일: testbuiltin.py 프로젝트: chaosim/dao
 def test_and3(self):
   assert_raises(NoSolution, eval, and_(succeed, fail))
예제 #3
0
파일: testbuiltin.py 프로젝트: chaosim/dao
 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
파일: testbuiltin.py 프로젝트: chaosim/dao
 def test_and(self):
   eq_(eval(and_(succeed, succeed)), True)
예제 #5
0
파일: testbuiltin.py 프로젝트: chaosim/dao
 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)