Example #1
0
def test_label2():
    check_succ_cont((char('a').label('777'), 'abc'), ('a'), 'bc')
    check_fail_msg((char('b').label('777'), 'abc'), '777', 'abc')
Example #2
0
def test_pleft():
    check_succ_cont((char('a') << char(')'), 'a)bc'), ('a'), 'bc')
    check_succ_cont((char('(') >> char('a') << char(')'), '(a)bc'), ('a'),
                    'bc')
Example #3
0
def test_char():
    check_succ_cont((char('['), '[abc]'), ('['), 'abc]')
    check_succ_cont((char('9'), '987654321'), ('9'), '87654321')
    check_type((char('a'), '[abc]'), ParseError, '[abc]')
Example #4
0
def test_between():
    check_succ_cont((between(char('['), string('abc'), char(']')), '[abc]'),
                    'abc', '')