diff --git a/data/alias.journal b/data/alias.journal new file mode 100644 index 000000000..43e453198 --- /dev/null +++ b/data/alias.journal @@ -0,0 +1,2 @@ +alias expenses = equity:draw:personal +alias assets = assets:personal diff --git a/data/business.journal b/data/business.journal new file mode 100644 index 000000000..39287f58c --- /dev/null +++ b/data/business.journal @@ -0,0 +1,4 @@ +2014/1/1 + expenses:office supplies $1 + assets:business checking + diff --git a/data/personal.journal b/data/personal.journal new file mode 100644 index 000000000..ca0892bd8 --- /dev/null +++ b/data/personal.journal @@ -0,0 +1,4 @@ +2014/1/2 + expenses:food $1 + assets:cash + diff --git a/tests/cli/alias.journal b/tests/cli/alias.journal new file mode 120000 index 000000000..1b7f296b0 --- /dev/null +++ b/tests/cli/alias.journal @@ -0,0 +1 @@ +../../data/alias.journal \ No newline at end of file diff --git a/tests/cli/business.journal b/tests/cli/business.journal new file mode 120000 index 000000000..d8ae20f52 --- /dev/null +++ b/tests/cli/business.journal @@ -0,0 +1 @@ +../../data/business.journal \ No newline at end of file diff --git a/tests/cli/multiple-files.test b/tests/cli/multiple-files.test new file mode 100644 index 000000000..d981f8075 --- /dev/null +++ b/tests/cli/multiple-files.test @@ -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 diff --git a/tests/cli/personal.journal b/tests/cli/personal.journal new file mode 120000 index 000000000..9e94c310a --- /dev/null +++ b/tests/cli/personal.journal @@ -0,0 +1 @@ +../../data/personal.journal \ No newline at end of file