Skip to content

Commit

Permalink
Added another maths test.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonashaag committed Jul 6, 2010
1 parent 39680a5 commit c39086a
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions tests/test_maths.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,35 @@ def test_multiple(self):
)
])

def test_with_vars_and_calls(self):
self.assert_generates_ast('''
a as Int = 5 ** 0.7
b as Float = 0.2 * sqrt(2) * a / blah(a*sqrt(2))
''',
[
Definition(
Declaration(_('a'), _('Int')),
MathExpression(Integer(5), OP.POW, Float(0.7))
),
Definition(
Declaration(_('b'), _('Float')),
MathExpression(
Float(0.2),
OP.MULTIPLY,
Call(_('sqrt'), [Integer(2)]),
OP.MULTIPLY,
_('a'),
OP.DIVIDE,
Call(_('blah'),
[MathExpression(
_('a'),
OP.MULTIPLY,
Call(_('sqrt'), [Integer(2)])
)]
)
)
)
])


if __name__ == '__main__':
Expand Down

0 comments on commit c39086a

Please sign in to comment.