;dev: tests: ledger-compat tests cleanup

This commit is contained in:
Simon Michael 2023-10-29 00:11:03 +01:00
parent 65efc8b87f
commit abc99d8dca
443 changed files with 36 additions and 30 deletions

View File

@ -525,7 +525,7 @@ functest: hledger/test/addons/hledger-addon \
@$(STACK) build --fast hledger
@($(SHELLTESTSTK) --hide-successes -w $(FUNCTESTEXE) \
hledger/test/ bin/ \
-x ledger-compat/baseline -x ledger-compat/regress -x ledger-compat/collected \
-x ledger-compat/ledger-baseline -x ledger-compat/ledger-regress -x ledger-compat/ledger-extra \
&& echo $@ PASSED) || (echo $@ FAILED; false)
# keep shelltest command synced with above
@ -534,7 +534,7 @@ functest-%: hledger/test/addons/hledger-addon \
@$(STACK) build --fast hledger
@($(SHELLTESTSTK) -i "$*" -w $(FUNCTESTEXE) \
hledger/test/ bin/ \
-x ledger-compat/baseline -x ledger-compat/regress -x ledger-compat/collected \
-x ledger-compat/ledger-baseline -x ledger-compat/ledger-regress -x ledger-compat/ledger-extra \
&& echo $@ PASSED) || (echo $@ FAILED; false)
ADDONEXTS=pl py rb sh hs lhs rkt exe com bat

View File

@ -1,9 +1,19 @@
Ledger compatibility tests, focussed on reading journal files for now.
See https://github.com/simonmichael/hledger/issues/1962
Tests of Ledger compatibility, focussed on reading journal format for now.
See https://github.com/simonmichael/hledger/issues/1962.
baseline/ and regress/ are a snapshot of Ledger's functional tests,
with all but the sample data commented, converted to shelltests which
test reading.
The hledger-* tests test hledger's main journal syntax,
other journal syntax supported by hledger,
and some Ledger journal syntax that we currently don't support.
test runs all tests and saves a dated pretty log which can be browsed
with org mode.
The ledger-* directories contain examples and reference tests
but are not part of hledger's functional test suite currently.
ledger-baseline/ and ledger-regress/ are a snapshot of Ledger's
functional tests, with all but the sample data commented, and
converted to shelltests which test reading with hledger.
ledger-extra/ are additional tests of ledger journal format compatibility.
Scripts:
./find finds files to test.
./test runs all tests and saves a dated pretty log which can be browsed with org mode.

View File

@ -1,4 +1,4 @@
# * summary of main hledger journal syntax
# * main syntax supported in hledger journal format
# keep synced with hledger.m4.md
# Here is the main syntax of hledger's journal format

View File

@ -1,7 +1,7 @@
# hledger journal "other"/legacy syntax -*- ledger -*-
# * other syntax supported in hledger journal format
# keep synced with hledger.m4.md
# `apply account` set a default parent account
# * 1. `apply account` set a default parent account
<
apply account per
@ -12,24 +12,24 @@ apply account per
end apply account
$ hledger -f- check
# `D AMT` set a default commodity and its format
# * 2. `D AMT` set a default commodity and its format
<
D $0.0
$ hledger -f- check
# star comment line
# * 3. star comment line
<
*
$ hledger -f- check
# `=` An automated transaction
# * 4. `=` An automated transaction
<
= expenses:food
(budget:food) *-1
$ hledger -f- check
# `Y`/`year` set the year for year-less dates
# * 5. `Y`/`year` set the year for year-less dates
<
Y 1111
1/1
@ -46,7 +46,7 @@ $ hledger -f- print
>=
# ignored directives
# * 6. ignored directives
<
apply fixed CAD $0.90
apply tag tag1:val1
@ -79,7 +79,7 @@ eval foo
$ hledger -f- check
# amount valuation, ignored
# * 7. amount valuation, ignored
<
;; Lastly, you can specify the valuation function/value for any specific
;; amount using the (( )) commodity annotation.
@ -88,7 +88,7 @@ $ hledger -f- check
Assets:Cash
$ hledger -f- check
# lot notation
# * 8. lot notation
# ,testCase "only lot price" $ assertParse (postingp Nothing) " a 1A {1B}\n"
# ,testCase "fixed lot price" $ assertParse (postingp Nothing) " a 1A {=1B}\n"
# ,testCase "total lot price" $ assertParse (postingp Nothing) " a 1A {{1B}}\n"

View File

@ -1,7 +1,7 @@
# Ledger syntax currently not parsed by hledger. -*- ledger -*-
# * Ledger syntax currently not supported in hledger journal format
# Reading these is expected to fail.
# `%` and `|` comment lines
# ** 1. `%` and `|` comment lines
<
%
|
@ -9,7 +9,7 @@ $ hledger -f- check
>2//
>=1
# `end` or `end apply` as shorthand for closing the most recent "apply FOO".
# ** 2. `end` or `end apply` as shorthand for closing the most recent "apply FOO".
<
apply account a
end apply
@ -19,14 +19,14 @@ $ hledger -f- check
>2//
>=1
# `test`, a synonym for `comment`
# ** 3. `test`, a synonym for `comment`
<
test
$ hledger -f- check
>2//
>=1
# `I, i, O, o, b, h` embedded timeclock entries
# ** 4. `I, i, O, o, b, h` embedded timeclock entries
<
i 2013/04/05 12:00:00 Personal:Lunch
o 2013/04/05 13:30:00
@ -34,7 +34,7 @@ $ hledger -f- check
>2//
>=1
# amount expressions
# ** 5. amount expressions
<
2022-01-01
(a) (1 + 1)

Some files were not shown because too many files have changed in this diff Show More