Skip to content

Commit 22ea58a

Browse files
committed
;dev:tests:errors: update readme, tests
1 parent 5849c78 commit 22ea58a

30 files changed

+75
-62
lines changed

hledger/test/errors/README.md

Lines changed: 34 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -159,20 +159,20 @@ Click error names to see an example. The table headings mean:
159159

160160

161161
<!-- GENERATED: -->
162-
hledger 1.40.99-gd6e34d8cd-20241102 error messages:
162+
hledger 1.50.99-g9031612c3-20251117 error messages:
163163

164164
### accounts
165165
```
166166
hledger: Error: /Users/simon/src/hledger/hledger/test/errors/./accounts.j:4:
167167
| 2022-01-01
168-
4 | (a) 1
168+
4 | (ß) 1
169169
| ^
170170
171171
Strict account checking is enabled, and
172-
account "a" has not been declared.
172+
account "ß" has not been declared.
173173
Consider adding an account directive. Examples:
174174
175-
account a
175+
account ß
176176
```
177177

178178

@@ -201,7 +201,6 @@ hledger: Error: /Users/simon/src/hledger/hledger/test/errors/./autobalanced.j:3-
201201
202202
This transaction is unbalanced.
203203
The real postings' sum should be 0 but is: 1
204-
Consider adjusting this entry's amounts, or adding missing postings.
205204
```
206205

207206

@@ -340,31 +339,33 @@ Consider changing these account names so their last parts are different.
340339

341340
### tcclockouttime
342341
```
343-
hledger: Error: /Users/simon/src/hledger/hledger/test/errors/./tcclockouttime.timeclock:5:1:
344-
| i 2022-01-01 00:01:00
342+
hledger: Error: /Users/simon/src/hledger/hledger/test/errors/./tcclockouttime.timeclock:4:1:
343+
4 | i 2022-01-01 00:01:00 a
344+
/Users/simon/src/hledger/hledger/test/errors/./tcclockouttime.timeclock:5:1:
345345
5 | o 2022-01-01 00:00:00
346-
| ^^^^^^^^^^^^^^^^^^^
347-
348-
This clockout time (2022-01-01 00:00:00) is earlier than the previous clockin.
349-
Please adjust it to be later than 2022-01-01 00:01:00.
346+
:
347+
This clockout is earlier than the clockin.
350348
```
351349

352350

353351
### tcorderedactions
354352
```
355353
hledger: Error: /Users/simon/src/hledger/hledger/test/errors/./tcorderedactions.timeclock:8:1:
356-
8 | i 2022-01-01 00:01:00
357-
| ^
354+
8 | i 2022-01-01 00:01:00 a
355+
356+
overlaps with session beginning at:
358357
359-
Expected a timeclock o entry but got i.
360-
Please alternate i and o, beginning with i.
358+
/Users/simon/src/hledger/hledger/test/errors/./tcorderedactions.timeclock:7:1:
359+
7 | i 2022-01-01 00:00:00 a
360+
361+
Overlapping sessions with the same account name are not supported.
361362
```
362363

363364

364365
### csvamountonenonzero
365366
```
366367
hledger: Error: in CSV rules:
367-
While processing CSV record: "2022-01-03","1","2"
368+
While processing record: 2022-01-03,1,2
368369
while calculating amount for posting 1
369370
rule "amount-in %2" assigned value "1"
370371
rule "amount-out %3" assigned value "2"
@@ -378,8 +379,8 @@ See also: https://hledger.org/hledger.html#setting-amounts
378379

379380
### csvamountparse
380381
```
381-
hledger: Error: error: could not parse "badamount" as an amount
382-
CSV record: "2022-01-03","badamount"
382+
hledger: Error: could not parse "badamount" as an amount
383+
record: 2022-01-03,badamount
383384
the amount rule is: %2
384385
the date rule is: %1
385386
@@ -396,8 +397,8 @@ you may need to change your amount*, balance*, or currency* rules, or add or cha
396397

397398
### csvbalanceparse
398399
```
399-
hledger: Error: error: could not parse "badbalance" as balance1 amount
400-
CSV record: "2022-01-03","badbalance"
400+
hledger: Error: could not parse "badbalance" as balance1 amount
401+
record: 2022-01-03,badbalance
401402
the balance rule is: %2
402403
the date rule is: %1
403404
@@ -413,16 +414,16 @@ expecting '+', '-', or number
413414
### csvbalancetypeparse
414415
```
415416
hledger: Error: balance-type "badtype" is invalid. Use =, ==, =* or ==*.
416-
CSV record: "2022-01-01","1"
417+
record: 2022-01-01,1
417418
the balance rule is: %2
418419
the date rule is: %1
419420
```
420421

421422

422423
### csvdateformat
423424
```
424-
hledger: Error: error: could not parse "a" as a date using date format "YYYY/M/D", "YYYY-M-D" or "YYYY.M.D"
425-
CSV record: "a","b"
425+
hledger: Error: could not parse "a" as a date using date format "YYYY/M/D", "YYYY-M-D" or "YYYY.M.D"
426+
record: a,b
426427
the date rule is: %1
427428
the date-format is: unspecified
428429
you may need to change your date rule, add a date-format rule, or change your skip rule
@@ -432,8 +433,8 @@ for m/d/y or d/m/y dates, use date-format %-m/%-d/%Y or date-format %-d/%-m/%Y
432433

433434
### csvdateparse
434435
```
435-
hledger: Error: error: could not parse "baddate" as a date using date format "%Y-%m-%d"
436-
CSV record: "baddate","b"
436+
hledger: Error: could not parse "baddate" as a date using date format "%Y-%m-%d"
437+
record: baddate,b
437438
the date rule is: %1
438439
the date-format is: %Y-%m-%d
439440
you may need to change your date rule, change your date-format rule, or change your skip rule
@@ -498,19 +499,24 @@ line of conditional table should have 2 values, but this one has only 1
498499

499500
### csvnoinclude
500501
```
501-
hledger: Error: sorry, CSV files can't be included yet
502+
hledger: Error: in file included from /Users/simon/src/hledger/hledger/test/errors/./csvnoinclude.j,
503+
/Users/simon/src/hledger/hledger/test/errors/csvnoinclude.csv:1:1:
504+
|
505+
1 | <empty line>
506+
| ^
507+
sorry, CSV files can't be included yet
502508
```
503509

504510

505511
### csvskipvalue
506512
```
507-
hledger: Error: could not parse skip value: "badval"
513+
hledger: Error: could not parse skip value: badval
508514
```
509515

510516

511517
### csvstatusparse
512518
```
513-
hledger: Error: error: could not parse "badstatus" as a cleared status (should be *, ! or empty)
519+
hledger: Error: could not parse status value "badstatus" (should be *, ! or empty)
514520
the parse error is: 1:1:
515521
|
516522
1 | badstatus

hledger/test/errors/accounts.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
$$$ hledger check accounts -f accounts.j
2-
>>>2 /Error: .*accounts.j:4:
2+
>>>2 /hledger: Error: .*accounts.j:4:
33
\| 2022-01-01
44
4 \| \(ß\) 1
55
\| \^

hledger/test/errors/assertions.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
$$$ hledger check -f assertions.j
2-
>>>2 /Error: .*assertions.j:4:8:
2+
>>>2 /hledger: Error: .*assertions.j:4:8:
33
\| 2022-01-01
44
4 \| a 0 = 1
55
\| \^\^\^

hledger/test/errors/autobalanced.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
$$$ hledger check -f autobalanced.j
2-
>>>2 /Error: .*autobalanced.j:3-4:
2+
>>>2 /hledger: Error: .*autobalanced.j:3-4:
33
3 \| 2022-01-01
44
\| a 1
55

hledger/test/errors/balanced.test

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
$$$ hledger check balanced -f balanced.j
2-
>>>2 /Error: .*balanced.j:5-7:
2+
>>>2 /hledger: Error: .*balanced.j:5-7:
33
5 \| 2022-01-01
44
\| a 1 A
55
\| b -1 B
66

77
This multi-commodity transaction is unbalanced.
88
Automatic commodity conversion is not enabled.
9-
The real postings' sum should be 0 but is: 1 A, -1 B/
9+
The real postings' sum should be 0 but is: 1 A, -1 B
10+
Consider adjusting this entry's amounts, adding/
1011
>>>= 1

hledger/test/errors/commodities.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
$$$ hledger check commodities -f commodities.j
2-
>>>2 /Error: .*commodities.j:6:
2+
>>>2 /hledger: Error: .*commodities.j:6:
33
\| 2022-01-01
44
6 \| \(a\) A 1
55
\| \^\^\^
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
$$$ hledger check -f csvamountonenonzero.csv
2-
>>>2 /Error: in CSV rules:
2+
>>>2 /hledger: Error: in CSV rules:
33
While processing record: 2022-01-03,1,2
44
while calculating amount for posting 1
55
rule "amount-in %2" assigned value "1"
66
rule "amount-out %3" assigned value "2"
77

88
Multiple non-zero amounts were assigned for an amount field.
9-
Please ensure just one non-zero amount i/
9+
Please ensure just one non-zero amount is assigned/
1010
>>>= 1

hledger/test/errors/csvamountparse.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
$$$ hledger check -f csvamountparse.csv
2-
>>>2 /Error: could not parse "badamount" as an amount
2+
>>>2 /hledger: Error: could not parse "badamount" as an amount
33
record: 2022-01-03,badamount
44
the amount rule is: %2
55
the date rule is: %1
@@ -11,5 +11,5 @@ the parse error is: 1:10:
1111
unexpected end of input
1212
expecting '\+', '-', or number
1313

14-
you may need to change your am/
14+
you may need to change your amount\*, balance/
1515
>>>= 1

hledger/test/errors/csvbalanceparse.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
$$$ hledger check -f csvbalanceparse.csv
2-
>>>2 /Error: could not parse "badbalance" as balance1 amount
2+
>>>2 /hledger: Error: could not parse "badbalance" as balance1 amount
33
record: 2022-01-03,badbalance
44
the balance rule is: %2
55
the date rule is: %1

hledger/test/errors/csvbalancetypeparse.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
$$$ hledger check -f csvbalancetypeparse.csv
2-
>>>2 /Error: balance-type "badtype" is invalid. Use =, ==, =\* or ==\*.
2+
>>>2 /hledger: Error: balance-type "badtype" is invalid. Use =, ==, =\* or ==\*.
33
record: 2022-01-01,1
44
the balance rule is: %2
55
the date rule is: %1

0 commit comments

Comments
 (0)