# * bin/hledger-move.hs

2022/01/01
    (f)               1
    (f:ff)            1
    (f:ff:fff)        1
    (n)              -1
    (t)               0

# ** 1. TOACCT must exist
$ hledger-move -f- --today=2000-01-01 0 f unknown
>2 /Error: unknown did not match any account./
>=1

# ** 2. Can create an entry moving zero
$ hledger-move -f- --today=2000-01-01 0 f t
2000-01-01
    f               0
    t               0

>=

# ** 3. Funds are moved from parent account first
$ hledger-move -f- --today=2000-01-01 1 f t
2000-01-01
    f              -1
    t               1

>=

# ** 4. Then from subaccounts as needed
$ hledger-move -f- --today=2000-01-01 2 f t
2000-01-01
    f                 -1
    f:ff              -1
    t                  1
    t:ff               1

>=

# ** 5. Insufficient funds to move gives an error
$ hledger-move -f- --today=2000-01-01 10 f t
>2 /Error: could not move 10, only 3 is available/
>=1

# ** 6. And you can't move funds from a negative balance
$ hledger-move -f- --today=2000-01-01 1 n t
>2 /Error: could not move 1, only -1 is available/
>=1

# ** 7. A negative amount is not easily entered
$ hledger-move -f- --today=2000-01-01 '-1' f t
>2 /Error: Unknown flag: -1/
>=1

# ** 8. It can be done with -- (and hledger-move, not hledger move), but will be rejected.
$ hledger-move -f- --today=2000-01-01 -- -1 f t
>2 /please specify a positive amount/
>=1
