summaryrefslogtreecommitdiff
path: root/test/regress
diff options
context:
space:
mode:
authorthdox <thdox@free.fr>2017-01-16 18:54:34 +0100
committerGitHub <noreply@github.com>2017-01-16 18:54:34 +0100
commitaa6c214e8dea5f79c3b3ac13e634783f68e8c375 (patch)
tree0c3de94a13f782f593ce50f649dc14b8c3f5af40 /test/regress
parent65eda1b0482f0db0a1842a77d95fba7612e369fb (diff)
parent58af4cfb4aaf460768e0246ca3b72d90b36a7d0d (diff)
downloadfork-ledger-aa6c214e8dea5f79c3b3ac13e634783f68e8c375.tar.gz
fork-ledger-aa6c214e8dea5f79c3b3ac13e634783f68e8c375.tar.bz2
fork-ledger-aa6c214e8dea5f79c3b3ac13e634783f68e8c375.zip
Merge pull request #477 from thdox/bug-584-550
Add regress test for bugs 550 and 584
Diffstat (limited to 'test/regress')
-rw-r--r--test/regress/550-584.test73
1 files changed, 73 insertions, 0 deletions
diff --git a/test/regress/550-584.test b/test/regress/550-584.test
new file mode 100644
index 00000000..1c3be3b8
--- /dev/null
+++ b/test/regress/550-584.test
@@ -0,0 +1,73 @@
+; this file contains spaces after the payee and tag values. Ledger
+; should ignore the trailing spaces for the purposes of determining
+; unique values
+;
+; bug 584 and 550 reported trailing spaces being considered
+; significant in payee and tag values.
+;
+; running
+; ledger -f test/spaces.dat payees
+; yielded two distinct payees, because utils.h/next_element() didn't
+; handle a single space followed by a null correctly.
+;
+; running
+; ledger -f test/spaces.dat reg --group-by "tag('test')"
+; yielded four groups.
+
+2011/11/28 * test
+ ; no space after payee or tag value
+ Expenses:misc $1 ; test: spaces
+ Assets:checking
+
+2011/11/28 * test
+ ; single space after payee and tag value
+ Expenses:misc $2 ; test: spaces
+ Assets:checking
+
+2011/11/28 test
+ ; two spaces after payee and tag value
+ Expenses:misc $4 ; test: spaces
+ Assets:checking
+
+2011/11/28 test
+ ; three spaces after payee and tag value
+ Expenses:misc $8 ; test: spaces
+ Assets:checking
+
+2011/11/28 testcommodity
+ ; COM commodity has no space after
+ Expenses:misc 1 COM
+ Assets:checking
+
+2011/11/28 testcommodity
+ ; COM commodity has one space after
+ Expenses:misc 1 COM
+ Assets:checking
+
+2011/11/28 testcommodity
+ ; COM commodity has two spaces after
+ Expenses:misc 1 COM
+ Assets:checking
+
+2011/11/28 testcommodity
+ ; COM commodity has three spaces after
+ Expenses:misc 1 COM
+ Assets:checking
+
+test payees
+test
+testcommodity
+end test
+
+test reg --group-by "tag('test')"
+spaces
+11-Nov-28 test Expenses:misc $1 $1
+11-Nov-28 test Expenses:misc $2 $3
+11-Nov-28 test Expenses:misc $4 $7
+11-Nov-28 test Expenses:misc $8 $15
+end test
+
+test commodities
+$
+COM
+end test