;dev: cli: ledger tests: move test runner up, start collected tests
This commit is contained in:
parent
370948a357
commit
1b56687708
11
hledger/test/ledger-compat/collected/balancing-precision.j
Normal file
11
hledger/test/ledger-compat/collected/balancing-precision.j
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
; In this journal, $'s precision is 2 in txn1, 4 in txn2, and 4 globally.
|
||||||
|
; Ledger checks transaction balancedness using local precisions only,
|
||||||
|
; so it accepts txn1's $-0.00045312 imbalance.
|
||||||
|
|
||||||
|
2022-01-01 txn1
|
||||||
|
expenses AAA 989.02 @ $1.123456 ; $1111.12045312
|
||||||
|
checking $-1111.12
|
||||||
|
|
||||||
|
2022-01-02 txn2
|
||||||
|
expenses $0.1234
|
||||||
|
checking
|
||||||
@ -2,15 +2,18 @@
|
|||||||
# Try to read all .test files, save and report the results.
|
# Try to read all .test files, save and report the results.
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
for f in *.test; do
|
FILES=$(find . -name "*.j" -o -name "*.test")
|
||||||
printf "%s: " "$f"
|
#FILES=$(find . -name "*.j")
|
||||||
|
|
||||||
|
for f in $FILES ; do
|
||||||
|
printf ":%s: " "$f"
|
||||||
(hledger -f "$f" stats >/dev/null && echo ok) || echo fail
|
(hledger -f "$f" stats >/dev/null && echo ok) || echo fail
|
||||||
# (hledger -f "$f" stats >/dev/null 2>&1 && echo ok) || echo fail
|
# (hledger -f "$f" stats >/dev/null 2>&1 && echo ok) || echo fail
|
||||||
# printf "." 1>&2
|
# printf "." 1>&2
|
||||||
done 2>&1 | tee log
|
done 2>&1 | tee log
|
||||||
echo
|
echo
|
||||||
cp log log."$(date +%Y%m%d)"
|
cp log log."$(date +%Y%m%d)"
|
||||||
printf "files: "; rg -c '\.test:' log || echo 0
|
printf "test files: %4d\n" "$(rg -c '^:' log || echo 0)"
|
||||||
printf "read: "; rg -c ': ok$' log || echo 0
|
printf "success: %4d\n" "$(rg -c ': ok$' log || echo 0)"
|
||||||
printf "failed: "; rg -c '(^|: )fail$' log || echo 0
|
printf "failure: %4d\n" "$(rg -c '(^|: )fail$' log || echo 0)"
|
||||||
echo "tested on $(date +%Y-%m-%d) with $(hledger --version)"
|
echo "tested on $(date +%Y-%m-%d) with $(hledger --version)"
|
||||||
Loading…
Reference in New Issue
Block a user