From fe2a1b35da967502db7ccbdd5333f0a9351cef78 Mon Sep 17 00:00:00 2001 From: Nicholas Niro Date: Thu, 6 Jul 2017 12:50:37 -0400 Subject: [PATCH] lib: Added 2 new tests to BalanceReport. These tests verify the behavior when we input a very specific period. The second test is meant to make sure that the new upcoming code in MultiBalanceReports will not change anything in the behavior of the module BalanceReport. --- hledger-lib/Hledger/Reports/BalanceReport.hs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/hledger-lib/Hledger/Reports/BalanceReport.hs b/hledger-lib/Hledger/Reports/BalanceReport.hs index 7e65e866a..c4e2fea72 100644 --- a/hledger-lib/Hledger/Reports/BalanceReport.hs +++ b/hledger-lib/Hledger/Reports/BalanceReport.hs @@ -281,6 +281,20 @@ tests_balanceReport = ], Mixed [usd0]) + ,"balanceReport with period on a populated period" ~: do + (defreportopts{period_= PeriodBetween (fromGregorian 2008 1 1) (fromGregorian 2008 1 2)}, samplejournal) `gives` + ( + [ + ("assets:bank:checking","assets:bank:checking",0, mamountp' "$1.00") + ,("income:salary","income:salary",0, mamountp' "$-1.00") + ], + Mixed [usd0]) + + ,"balanceReport with period on an unpopulated period" ~: do + (defreportopts{period_= PeriodBetween (fromGregorian 2008 1 2) (fromGregorian 2008 1 3)}, samplejournal) `gives` + ([],Mixed [nullamt]) + + {- ,"accounts report with account pattern o" ~: