Added more baseline testing, for valexprs and Python

This commit is contained in:
John Wiegley 2012-03-01 22:20:20 -06:00
parent 4e37748999
commit a0c9ab08dc
3 changed files with 32 additions and 3 deletions

View file

@ -1,3 +1,12 @@
test eval 'foo(w, u)=(z=w+u;z*2); (a=1 + 1; foo(10, 15))'
50
end test
test eval 'foo(x, y, z)=print(x, y, z); bar(x)=x; foo(1, 2, 3); bar(3)'
123
3
end test
test eval 'total_expr=$100;amount_expr=$15;x=total_expr;x=x/5;x=amount_expr-x*5;x'
$-85
end test

View file

@ -1,3 +0,0 @@
test eval 'total_expr=$100;amount_expr=$15;x=total_expr;x=x/5;x=amount_expr-x*5;x'
$-85
end test

View file

@ -0,0 +1,23 @@
python
def print_type(val):
print type(val), val
eval print_type(true)
eval print_type([2010/08/10])
eval print_type(10)
eval print_type($10.00)
eval print_type($10.00 + CAD 30)
eval print_type("Hello!")
eval print_type(/Hello!/)
;eval print_type((1, 2, 3))
test reg
<type 'bool'> True
<type 'datetime.date'> 2010-08-10
<class 'ledger.Amount'> 10
<class 'ledger.Amount'> $10.00
<class 'ledger.Balance'> $10.00
CAD 30
<type 'unicode'> Hello!
<class 'ledger.Value'> Hello!
end test