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