From aa5323e6ed2da528c9aef81119af234570479bf3 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Wed, 21 Dec 2022 23:17:54 -1000 Subject: [PATCH] dev: journal: update ledger-unsupported, directives tests --- hledger/test/journal/directives.test | 14 +++++ .../syntax/hledger-ledger-unsupported.test | 57 ++++++++----------- 2 files changed, 39 insertions(+), 32 deletions(-) diff --git a/hledger/test/journal/directives.test b/hledger/test/journal/directives.test index fe5ca7bcc..bc105554c 100644 --- a/hledger/test/journal/directives.test +++ b/hledger/test/journal/directives.test @@ -18,6 +18,7 @@ a:b aa:b c +# Y, year directives < Y 1111 1/1 @@ -29,3 +30,16 @@ $ hledger -f- print 2222-02-02 >= + +# Legacy ! and @ prefixes are accepted. +< +!Y 1111 +1/1 +@year 2222 +2/2 +$ hledger -f- print +1111-01-01 + +2222-02-02 + +>= diff --git a/hledger/test/ledger-compat/syntax/hledger-ledger-unsupported.test b/hledger/test/ledger-compat/syntax/hledger-ledger-unsupported.test index 895b7d684..9de1e5cf7 100644 --- a/hledger/test/ledger-compat/syntax/hledger-ledger-unsupported.test +++ b/hledger/test/ledger-compat/syntax/hledger-ledger-unsupported.test @@ -1,4 +1,4 @@ -# Ledger syntax currently not supported by hledger. -*- ledger -*- +# Ledger syntax currently not parsed by hledger. -*- ledger -*- # Reading these is expected to fail. # `;` `#` `%` `*` `|` comment lines @@ -9,42 +9,14 @@ $ hledger -f- check >2// >=1 -# `!` or `@` as a directive prefix +# `end` close block commands like `apply` or `comment` (ignores any words after "end") < -@comment +apply account a +end $ hledger -f- check >2// >=1 -# `account` subdirectives -< -account Expenses:Food - note This account is all about the chicken! - alias food - payee ^(KFC|Popeyes)$ - check commodity == "$" - assert commodity == "$" - eval print("Hello!") - default -2022-01-01 - (food) 1 -$ hledger -f- accounts # -> both account names printed, alias did not work -Expenses:Food -food - -# `end` close block commands like `apply` or `comment` (ignores any words after "end") -< -comment -1111-01-01 -end -2222-02-02 -$ hledger -f- print # -> nothing printed, comment did not end - -# `tag` pre-declare tag names -< -tag tag1 -$ hledger -f- tags # -> nothing printed, tag not declared - # `test`, a synonym for `comment` < test @@ -61,5 +33,26 @@ $ hledger -f- check >=1 # amount expressions +< +2022-01-01 + (a) (1 + 1) +$ hledger -f- check +>2// +>=1 # lot notation +< +2012-04-10 + Assets:Brokerage:Cash $375.00 + Assets:Brokerage -5 AAPL {$50.00} [2012-04-10] (Oh my!) @@ $375.00 + Income:Capital Gains $-125.00 +$ hledger -f- check +>2// +>=1 + +# command line options +< +--strict +$ hledger -f- check +>2// +>=1