From fbf8b2458c6ae3ad2ed2bf0575b94800722d5a04 Mon Sep 17 00:00:00 2001 From: Michael Budde Date: Sat, 16 Feb 2019 21:24:44 +0100 Subject: Fix tag value parsing If a tag is more than 2 characters from the beginning of the comment the tag value offset will be wrong. #1702 gives an example where the tag line starts with `;;` and the tag value thus becomes `: Bar` because of this bug. The use `index` in the offset calulation seems to be a lucky coincidence that works in the common case: "; tag: value" Fixes #1702 --- test/regress/1702.test | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 test/regress/1702.test (limited to 'test/regress') diff --git a/test/regress/1702.test b/test/regress/1702.test new file mode 100644 index 00000000..813cf37b --- /dev/null +++ b/test/regress/1702.test @@ -0,0 +1,17 @@ +tag Foo + assert value =~ /^Bar$/ + +2019/01/01 * Payee + ;; Foo: Bar + Income:Foo $-1 + Assets:Cash $1 +2019/01/01 * Another Payee + Assets:Cash $-1 + Expenses:Baz $1 + +test bal + $1 Expenses:Baz + $-1 Income:Foo +-------------------- + 0 +end test -- cgit v1.2.3