def test_attribute_array(): assert DefaultParser().parse('["foo", "bar"].length') == Identifier( value='length', subject=ArrayLiteral([Literal('foo'), Literal('bar')]))
def test_nexted_array_literals(): assert DefaultParser().parse('["foo", ["bar", "tek"]]') == ArrayLiteral( [Literal('foo'), ArrayLiteral([Literal('bar'), Literal('tek')])])
def test_empty_array_literals(): assert DefaultParser().parse('[]') == ArrayLiteral([])
def test_array_literals(): assert DefaultParser().parse('["foo", 1+2]') == ArrayLiteral([ Literal('foo'), BinaryExpression(operator=_ops['+'], left=Literal(1), right=Literal(2)) ])