Exemple #1
0
 def test_dummy_seplist(self):
     _, Y = DummyVar('_'), Var('Y')
     eq_(
         eval(
             begin(parse_text(seplist(char(_), char(','), _, Y), '2,2,2'),
                   Y)), ['2', '2', '2'])
     eq_(
         eval(
             begin(parse_text(seplist(char(_), char(','), _, Y), '2,3,4'),
                   Y)), ['2', '3', '4'])
     eq_(eval(begin(parse_text(seplist(char(_), char(','), _, Y), '2'), Y)),
         ['2'])
Exemple #2
0
 def test_seplist(self):
     X, Y = Var('X'), Var('Y')
     eq_(
         eval(
             begin(parse_text(seplist(char(X), char(','), X, Y), '2,2,2'),
                   Y)), ['2', '2', '2'])
     eq_(
         eval(
             begin(parse_text(seplist(char(X), char(','), X, Y), '2,3,4'),
                   Y)), ['2'])
     eq_(eval(begin(parse_text(seplist(char(X), char(','), X, Y), '2'), Y)),
         ['2'])
     eq_(eval(begin(parse_text(seplist(char(X), char(','), X, Y), ''), Y)),
         [])
Exemple #3
0
 def test_dummy_seplist(self):
   _, Y = DummyVar('_'), Var('Y')
   eq_(eval(begin(parse_text(seplist(char(_), char(','), _, Y), '2,2,2'), Y)), ['2','2','2'])
   eq_(eval(begin(parse_text(seplist(char(_), char(','), _, Y), '2,3,4'), Y)), ['2', '3', '4'])
   eq_(eval(begin(parse_text(seplist(char(_), char(','), _, Y), '2'), Y)), ['2'])
Exemple #4
0
 def test_seplist(self):
   X, Y = Var('X'), Var('Y')
   eq_(eval(begin(parse_text(seplist(char(X), char(','), X, Y), '2,2,2'), Y)), ['2','2','2'])
   eq_(eval(begin(parse_text(seplist(char(X), char(','), X, Y), '2,3,4'), Y)), ['2'])
   eq_(eval(begin(parse_text(seplist(char(X), char(','), X, Y), '2'), Y)), ['2'])
   eq_(eval(begin(parse_text(seplist(char(X), char(','), X, Y), ''), Y)), [])