Beispiel #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) 
Beispiel #2
0
 def test_and3(self):
   assert_raises(NoSolution, eval, and_(succeed, fail))
Beispiel #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)
Beispiel #4
0
 def test_and(self):
   eq_(eval(and_(succeed, succeed)), True)
Beispiel #5
0
 def test_and2(self):
   eq_(eval(and_(prin(1), prin(2))), None)
Beispiel #6
0
 def testnullword2(self):
   assert_raises(NoSolution, eval, parse_text(and_(nullword, eoi), 'a')) 
   eq_(eval(parse_text(nullword, '')), True)
Beispiel #7
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'))
Beispiel #8
0
 def testnullword2(self):
     assert_raises(NoSolution, eval, parse_text(and_(nullword, eoi), 'a'))
     eq_(eval(parse_text(nullword, '')), True)
Beispiel #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'))
Beispiel #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)
Beispiel #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)
Beispiel #12
0
 def test_and3(self):
     assert_raises(NoSolution, eval, and_(succeed, fail))
Beispiel #13
0
 def test_and2(self):
     eq_(eval(and_(prin(1), prin(2))), None)
Beispiel #14
0
 def test_and(self):
     eq_(eval(and_(succeed, succeed)), True)