summaryrefslogtreecommitdiff
path: root/test/baseline/opt-value-expr.test
blob: 8b68a80e3ba8f3531f0d71fe80a41f5995fdc200 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48

D 1000.00 EUR
D 1000.00 USD
D 1000.00 DM

2015-01-01 * Buy 2 FOO
    Assets:Investments                             2 FOO @@ 20.00 EUR
    Assets:Cash                                            -20.00 EUR

2015-05-01 * Spend on food
    Expenses:Food                                           20.00 USD
    ; Just to be silly, always valuate *these* $20 as 30 DM, no matter what
    ; the user asks for with -V or -X
    ; VALUE:: 30 DM
    Assets:Cash                                            -20.00 USD

P 2015-05-01 USD 20 DM

P 2015-06-01 USD 22 DM

test bal assets:investments -V --value-expr "25.00 EUR"
           50.00 EUR  Assets:Investments
end test

test bal assets:investments -G --value-expr "date < [March 2015] ? 22.00 EUR : 25.00 EUR" --now "2015-02-20"
           24.00 EUR  Assets:Investments
end test

test bal assets:investments -G --value-expr "date < [March 2015] ? 22.00 EUR : 25.00 EUR" --now "2015-03-20"
           30.00 EUR  Assets:Investments
end test

test bal expenses:food
           20.00 USD  Expenses:Food
end test

test bal expenses:food -V
           600.00 DM  Expenses:Food
end test

test bal expenses:food   -X "DM" --now "2015-05-02"
           600.00 DM  Expenses:Food
end test

test bal expenses:food   -X "DM" --now "2015-06-02"
           600.00 DM  Expenses:Food
end test