mirror of
https://github.com/simonmichael/hledger.git
synced 2024-11-07 21:15:19 +03:00
read multiple files: tests
This commit is contained in:
parent
49f1744ae5
commit
67432f1220
2
data/alias.journal
Normal file
2
data/alias.journal
Normal file
@ -0,0 +1,2 @@
|
||||
alias expenses = equity:draw:personal
|
||||
alias assets = assets:personal
|
4
data/business.journal
Normal file
4
data/business.journal
Normal file
@ -0,0 +1,4 @@
|
||||
2014/1/1
|
||||
expenses:office supplies $1
|
||||
assets:business checking
|
||||
|
4
data/personal.journal
Normal file
4
data/personal.journal
Normal file
@ -0,0 +1,4 @@
|
||||
2014/1/2
|
||||
expenses:food $1
|
||||
assets:cash
|
||||
|
1
tests/cli/alias.journal
Symbolic link
1
tests/cli/alias.journal
Symbolic link
@ -0,0 +1 @@
|
||||
../../data/alias.journal
|
1
tests/cli/business.journal
Symbolic link
1
tests/cli/business.journal
Symbolic link
@ -0,0 +1 @@
|
||||
../../data/business.journal
|
39
tests/cli/multiple-files.test
Normal file
39
tests/cli/multiple-files.test
Normal file
@ -0,0 +1,39 @@
|
||||
# 1. all data files on the command line should be read
|
||||
hledgerdev inc -f personal.journal -f business.journal
|
||||
>>>
|
||||
Income Statement
|
||||
|
||||
Revenues:
|
||||
--------------------
|
||||
0
|
||||
|
||||
Expenses:
|
||||
$2 expenses
|
||||
$1 food
|
||||
$1 office supplies
|
||||
--------------------
|
||||
$2
|
||||
|
||||
Total:
|
||||
--------------------
|
||||
$2
|
||||
>>>2
|
||||
>>>=0
|
||||
|
||||
# 2. aliases in files should only apply to later files
|
||||
hledgerdev print -f personal.journal -f business.journal -f alias.journal -f personal.journal
|
||||
>>>
|
||||
2014/01/01
|
||||
expenses:office supplies $1
|
||||
assets:business checking $-1
|
||||
|
||||
2014/01/02
|
||||
expenses:food $1
|
||||
assets:cash $-1
|
||||
|
||||
2014/01/02
|
||||
equity:draw:personal:food $1
|
||||
assets:personal:cash $-1
|
||||
|
||||
>>>2
|
||||
>>>=0
|
1
tests/cli/personal.journal
Symbolic link
1
tests/cli/personal.journal
Symbolic link
@ -0,0 +1 @@
|
||||
../../data/personal.journal
|
Loading…
Reference in New Issue
Block a user