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'])
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)))
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'])
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)))