dev: journal: update ledger-unsupported, directives tests

This commit is contained in:
Simon Michael 2022-12-21 23:17:54 -10:00
parent 9bac3950af
commit aa5323e6ed
2 changed files with 39 additions and 32 deletions

View File

@ -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
>=

View File

@ -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