# * check commodities
# ** 1. check commodities succeeds when all commodities are declared
<
commodity $1.
2020-01-01
  (a)  $1
$ hledger -f- check commodities

# ** 2. and otherwise fails
<
2020-01-01
  (a)  $1
$ hledger -f- check commodities
>2 /commodity "\$" has not been declared/
>=1

# ** 3. But commodityless zero amounts will not fail
<
2020-01-01
  (a)  0

$ hledger -f- check commodities
>=0

# ** 4. But zero amounts with undeclared commodities still fail
<
2020-01-01
  (a)  $0

$ hledger -f- check commodities
>2 /commodity "\$" has not been declared/
>=1
