Skip to content

Commit

Permalink
bs,is,cf: add functional tests, fix bs infinite loop #393
Browse files Browse the repository at this point in the history
  • Loading branch information
simonmichael committed Aug 13, 2016
1 parent ef961f5 commit 5ea088d
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 2 deletions.
3 changes: 1 addition & 2 deletions hledger/Hledger/Cli/Balancesheet.hs
Expand Up @@ -58,8 +58,7 @@ Total:
withoutBeginDate :: ReportOpts -> ReportOpts
withoutBeginDate ropts@ReportOpts{..} = ropts{period_=p}
where
p = dateSpanAsPeriod $ DateSpan Nothing e
e = periodEnd p
p = dateSpanAsPeriod $ DateSpan Nothing (periodEnd period_)

tests_Hledger_Cli_Balancesheet :: Test
tests_Hledger_Cli_Balancesheet = TestList
Expand Down
23 changes: 23 additions & 0 deletions tests/balancesheet/balancesheet.test
@@ -0,0 +1,23 @@
# 1.
hledger -f - balancesheet
<<<
2016/1/1
assets 1
b
>>>
Balance Sheet

Assets:
1 assets
--------------------
1

Liabilities:
--------------------
0

Total:
--------------------
1
>>>2
>>>= 0
19 changes: 19 additions & 0 deletions tests/cashflow/cashflow.test
@@ -0,0 +1,19 @@
# 1.
hledger -f - cashflow
<<<
2016/1/1
assets 1
b
>>>
Cashflow Statement

Cash flows:
1 assets
--------------------
1

Total:
--------------------
1
>>>2
>>>= 0
23 changes: 23 additions & 0 deletions tests/incomestatement/incomestatement.test
@@ -0,0 +1,23 @@
# 1.
hledger -f - incomestatement
<<<
2016/1/1
income 1
b
>>>
Income Statement

Revenues:
1 income
--------------------
1

Expenses:
--------------------
0

Total:
--------------------
1
>>>2
>>>= 0

0 comments on commit 5ea088d

Please sign in to comment.