def test_matches(self): p = atom() full_match(p, 'symbol', Symbol('symbol')) full_match(p, '"double_quote"', StringLiteral('"double_quote"')) full_match(p, "'single_quote'", StringLiteral("'single_quote'")) full_match(p, '1234', NumericLiteral('1234')) full_match(p, 'dotted.name', Symbol('dotted.name')) full_match(p, 'a', Symbol('a'))
def test_fails(self): p = atom() no_match(p, '{}weird') no_match(p, '') eq_(p('more than one'), (Symbol('more'), 'than one'))