From 18bed45e1af291b74959df114f06bea07c6b7372 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Wed, 21 Sep 2016 09:34:01 -0700 Subject: [PATCH] bal: draft some tests for #373 --- tests/balance/373-layout.test | 64 +++++++++++++++++++++++++++++++++++ tests/balance/373.journal | 12 +++++++ 2 files changed, 76 insertions(+) create mode 100644 tests/balance/373-layout.test create mode 100644 tests/balance/373.journal diff --git a/tests/balance/373-layout.test b/tests/balance/373-layout.test new file mode 100644 index 000000000..f1baf455f --- /dev/null +++ b/tests/balance/373-layout.test @@ -0,0 +1,64 @@ +# Indenting & eliding tests, cf issue 373. +# Documenting current behaviour, some of which looks wrong. + +# +#$ ledger bal +# 1 1:2:3 +# 1 4:5 +#-------------------- +# 0 +hledger -f 373.journal bal +>>> + 0 1:2 + 1 3 + 0 4 + 1 5 +-------------------- + 0 +>>>= 0 + +# +#$ ledger bal --flat +# 1 1:2:3 +# 1 1:2:3:4:5 +#-------------------- +# 0 +hledger -f 373.journal bal --flat +>>> + -1 1:2 + 1 1:2:3 + -1 1:2:3:4 + 1 1:2:3:4:5 +-------------------- + 0 +>>>= 0 + +# +hledger -f 373.journal bal -Y +>>> +Balance changes in 2015: + + || 2015 +===========++======= + 1:2 || -1 + 1:2:3 || 1 + 1:2:3:4 || -1 + 1:2:3:4:5 || 1 +-----------++------- + || 0 + +>>>=0 + +# +hledger -f 373.journal bal -Y --tree +>>> +Balance changes in 2015: + + || 2015 +===========++======= + 3 || 1 + 5 || 1 +-----------++------- + || + +>>>=0 diff --git a/tests/balance/373.journal b/tests/balance/373.journal new file mode 100644 index 000000000..fb0f5271c --- /dev/null +++ b/tests/balance/373.journal @@ -0,0 +1,12 @@ +2015-01-01 + 1 1 + 1:2 -1 + +2015-01-02 + 1:2:3 1 + 1:2:3:4 -1 + +2015-01-03 + 1:2:3:4:5 1 + 1 -1 +