diff --git a/tests/metadata.test b/tests/metadata.test index 6bdf97f0e..ca459ce31 100644 --- a/tests/metadata.test +++ b/tests/metadata.test @@ -1,16 +1,16 @@ -# we currently should parse and ignore ledger-style metadata attributes -# +# 1. we currently parse metadata tags on transactions and postings, printing +# the former and ignoring the latter bin/hledger -f - print <<< 2010/01/01 - ; txndata1: txn val 1 - ; txndata2: txn val 2 - a 1 - ; posting1data1: posting1 val 1 - ; posting1data2: - b -1 - ; posting2data1: -; posting2nonmetadata: + ; txndata1: txn val 1 + ; txndata2: txn val 2 + a 1 + ; posting1data1: posting1 val 1 + ; posting1data2: + b -1 + ; posting2data1: +; non-metadata: >>> 2010/01/01 a 1 @@ -19,27 +19,57 @@ bin/hledger -f - print >>>2 >>>=0 -bin/hledger -f - print tag key1=value +# 2. print (and a few other commands) can filter by tag value +bin/hledger -f - print tag foo=bar <<< 2010/01/01 - ; key:value - a 1 - b -1 ->>> ->>>2 ->>>=0 + ; foo:bar + a 1 + b -1 -bin/hledger -f - print tag key=value -<<< -2010/01/01 - ; key:value - a 1 - b -1 +2010/01/02 + ; foo:baz + c 1 + d -1 + +2010/01/03 + e 1 + f -1 >>> 2010/01/01 - ; key:value + ; 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