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