hledger/tests/metadata.test

82 lines
1.4 KiB
Plaintext

# 1. we parse metadata tags in transaction and posting comments. Currently,
# - they can be on the same line and/or separate lines
# - they are always printed on separate lines
bin/hledger -f - print
<<<
2010/01/01 ; txntag1: txn val 1
; txntag2: txn val 2
a 1
; posting1tag1: posting 1 val 1
; posting1tag2:
b -1 ; posting-2-tag-1: posting 2 val 1
; posting-2-tag-2:
; non-metadata:
>>>
2010/01/01
; txntag1: txn val 1
; txntag2: txn val 2
a 1
; posting1tag1: posting 1 val 1
; posting1tag2:
b -1
; posting-2-tag-1: posting 2 val 1
; posting-2-tag-2:
>>>2
>>>=0
# 2. print (and a few other commands) can filter by tag value
bin/hledger -f - print tag foo=bar
<<<
2010/01/01
; foo:bar
a 1
b -1
2010/01/02
; foo:baz
c 1
d -1
2010/01/03
e 1
f -1
>>>
2010/01/01
; foo: bar
a 1
b -1
>>>2
>>>=0
# # 3. or tag existence ? not yet
# bin/hledger -f - print tag foo
# <<<
# 2010/01/01
# ; foo:bar
# a 1
# b -1
# 2010/01/02
# ; foo:baz
# c 1
# d -1
# 2010/01/03
# e 1
# f -1
# >>>
# 2010/01/01
# ; foo:bar
# a 1
# b -1
# 2010/01/02
# ; foo:baz
# c 1
# d -1
# >>>2
# >>>=0