]> gitweb.factorcode.org Git - factor.git/blob - extra/bank/bank-tests.factor
ogg plays but 1) sound is broken and 2) it doesn't recognize EOF anymore, so it hangs...
[factor.git] / extra / bank / bank-tests.factor
1 USING: accessors arrays bank calendar kernel math math.functions namespaces tools.test tools.walker ;
2 IN: bank.tests
3
4 SYMBOL: my-account
5 [
6     "Alex's Take Over the World Fund" 0.07 1 2007 11 1 <date> 6101.94 open-account my-account set
7     [ 6137 ] [ my-account get 2007 12 2 <date> process-to-date balance>> round >integer ] unit-test
8     [ 6137 ] [ my-account get 2007 12 2 <date> process-to-date balance>> round >integer ] unit-test
9 ] with-scope
10
11 [
12     "Petty Cash" 0.07 1 2006 12 1 <date> 10962.18 open-account my-account set
13     [ 11027 ] [ my-account get 2007 1 2 <date> process-to-date balance>> round >integer ] unit-test
14 ] with-scope
15
16 [
17     "Saving to buy a pony" 0.0725 1 2008 3 3 <date> 11106.24 open-account my-account set
18     [ 8416 ] [
19             my-account get [
20                2008 3 11 <date> -750 "Need to buy food" <transaction> ,
21                2008 3 25 <date> -500 "Going to a party" <transaction> ,
22                2008 4  8 <date> -800 "Losing interest in the pony..." <transaction> ,
23                2008 4  8 <date> -700 "Buying a rocking horse" <transaction> ,
24             ] { } make inserting-transactions balance>> round >integer
25         ] unit-test
26 ] with-scope
27
28 [
29     [ 6781 ] [
30         "..." 0.07 1 2007 4 10 <date> 4398.50 open-account
31         2007 10 26 <date> 2000 "..." <transaction> 1array inserting-transactions
32         2008 4 10 <date> process-to-date dup balance>> swap unpaid-interest>> + round >integer
33     ] unit-test
34 ] with-scope