Beispiel #1
0
 def test_dummy_times_less_lazy(self):
     _, Y = DummyVar('_'), Var('Y')
     eq_(
         eval(
             preparse(
                 begin(
                     parse_text(
                         times_less(char(_), 3, _, Y, lazy) + char('4'),
                         '234'), Y))), ['2', '3'])
Beispiel #2
0
 def test_dummy_times_less(self):
     _, Y = DummyVar('_'), Var('Y')
     eq_(
         eval(
             preparse(
                 begin(
                     parse_text(
                         times_less(char(_), 3, _, Y) + char('4'), '234'),
                     Y))), ['2', '3'])
     eq_(eval(begin(parse_text(times_less(char(_), 3, _, Y), '234'), Y)),
         ['2', '3', '4'])
     eq_(eval(begin(parse_text(times_less(char(_), 3, _, Y), '23'), Y)),
         ['2', '3'])
     assert_raises(
         NoSolutionFound, eval,
         preparse(
             begin(parse_text(times_less(char(_), 3, _, Y) + eoi, '2345'),
                   Y)))
Beispiel #3
0
 def test_dummy_times_less_lazy(self):
   _, Y = DummyVar('_'), Var('Y')
   eq_(eval(preparse(begin(parse_text(times_less(char(_), 3, _, Y, lazy)+char('4'), '234'), Y))), ['2','3'])
Beispiel #4
0
 def test_dummy_times_less(self):
   _, Y = DummyVar('_'), Var('Y')
   eq_(eval(preparse(begin(parse_text(times_less(char(_), 3, _, Y)+char('4'), '234'), Y))), ['2','3'])
   eq_(eval(begin(parse_text(times_less(char(_), 3, _, Y), '234'), Y)), ['2','3','4'])
   eq_(eval(begin(parse_text(times_less(char(_), 3, _, Y), '23'), Y)), ['2','3'])
   assert_raises(NoSolutionFound, eval, preparse(begin(parse_text(times_less(char(_), 3, _, Y)+eoi, '2345'), Y)))