File: cmd-select.test

package info (click to toggle)
ledger 3.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,964 kB
  • sloc: cpp: 39,393; python: 4,476; perl: 1,309; sh: 477; lisp: 435; yacc: 103; makefile: 58
file content (62 lines) | stat: -rw-r--r-- 2,491 bytes parent folder | download | duplicates (7)
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
2012-02-28 * Test 1
    E               20.00 EUR
    F

2012-02-29 * Test 2
    Test            10.01 EUR
    F

2012-03-24 Test 3
    C               30.00 EUR
    D

2012-03-25 (test) Test 4
    ; Payee: Test 5
    E               40.00 GBP
    F

test select "date, account, amount" from posts
12-Feb-28 E                                                           20.00 EUR
12-Feb-28 F                                                          -20.00 EUR
12-Feb-29 Test                                                        10.01 EUR
12-Feb-29 F                                                          -10.01 EUR
12-Mar-24 C                                                           30.00 EUR
12-Mar-24 D                                                          -30.00 EUR
12-Mar-25 E                                                           40.00 GBP
12-Mar-25 F                                                          -40.00 GBP
end test

test select "date, account, amount from posts where account =~ /^e/"
12-Feb-28 E                                                           20.00 EUR
12-Mar-25 E                                                           40.00 GBP
end test

test select "date, account, amount from posts where account =~ /e/"
12-Feb-28 E                                                           20.00 EUR
12-Feb-29 Test                                                        10.01 EUR
12-Mar-25 E                                                           40.00 GBP
end test

; leave out "from posts" since it is the default
test select "date, account, amount where account =~ /e/"
12-Feb-28 E                                                           20.00 EUR
12-Feb-29 Test                                                        10.01 EUR
12-Mar-25 E                                                           40.00 GBP
end test

test select "date, payee, amount from posts where account =~ /e/ and commodity =~ /GBP/"
12-Mar-25 Test 5                                                      40.00 GBP
end test

test select "date, payee, amount * 2 from posts where account =~ /e/ and commodity =~ /GBP/"
12-Mar-25 Test 5                                                      80.00 GBP
end test

test select "date, code, amount from posts where account =~ /e/ and commodity =~ /GBP/"
12-Mar-25 test          40.00 GBP
end test

test select "date, code * 2, amount from posts where account =~ /e/ and commodity =~ /GBP/"
12-Mar-25 testtest      40.00 GBP
end test