File tree Expand file tree Collapse file tree 2 files changed +41
-1
lines changed
Expand file tree Collapse file tree 2 files changed +41
-1
lines changed Original file line number Diff line number Diff line change @@ -222,7 +222,18 @@ let s:valreg = '\('.
222222 \ ' \|' .
223223 \ ' [,.][0-9]\+' .
224224 \ ' \)'
225- let s: optional_balance_assertion = ' \(\s*=\s*' .s: cursym .' \s*' .s: valreg .' \)\?'
225+ let s: optsgn = ' [+-]\?'
226+ let s: cursgn = ' \(' .
227+ \ s: optsgn .
228+ \ ' \s*' .
229+ \ s: cursym .
230+ \ ' \|' .
231+ \ s: cursym .
232+ \ ' \s*' .
233+ \ s: optsgn .
234+ \ ' \)'
235+
236+ let s: optional_balance_assertion = ' \(\s*=\s*' .s: cursgn .' \s*' .s: valreg .' \)\?'
226237
227238let s: rx_amount = s: valreg .
228239 \ s: optional_balance_assertion .
Original file line number Diff line number Diff line change 1+ ; tests transactions for folds
2+
3+ 2025-01-01 test simple fold, no assertion, should read 100.10
4+ io:income
5+ assets:bank £ 100.10
6+
7+ 2025-01-01 test positive assertion. should read 100.20
8+ io:income
9+ assets:bank £ 100.20 = £ 200.10
10+
11+ 2025-01-01 no assertion, negative txn, should read -13
12+ io:income
13+ assets:bank £ -13
14+
15+ 2025-01-01 test negative assertion. should read -400
16+ io:income
17+ assets:bank £ -400 = £ -199.7
18+
19+ 2025-01-01 as above, sign and currency swapped. should read -400
20+ io:income
21+ assets:bank £ -400 = - £199.7
22+
23+ 2025-01-01 test positive assert. should be 10
24+ io:income
25+ assets:bank £ 10 = £ +12
26+
27+ 2025-01-01 test positive assert 2. should be 9
28+ io:income
29+ assets:bank £ 9 = + £ 12
You can’t perform that action at this time.
0 commit comments