mirror of
https://github.com/simonmichael/hledger.git
synced 2024-12-27 12:24:43 +03:00
hook up more tests, begin converting remaining reports to Query
This commit is contained in:
parent
2feb36e57f
commit
1e2c2bb10c
@ -3,9 +3,20 @@ module Hledger (
|
||||
,module Hledger.Read
|
||||
,module Hledger.Reports
|
||||
,module Hledger.Utils
|
||||
,tests_Hledger
|
||||
)
|
||||
where
|
||||
import Test.HUnit
|
||||
|
||||
import Hledger.Data
|
||||
import Hledger.Read
|
||||
import Hledger.Reports
|
||||
import Hledger.Utils
|
||||
|
||||
tests_Hledger = TestList
|
||||
[
|
||||
tests_Hledger_Data
|
||||
,tests_Hledger_Data_Query
|
||||
,tests_Hledger_Read
|
||||
,tests_Hledger_Reports
|
||||
]
|
||||
|
@ -232,6 +232,19 @@ entriesReport opts fspec j = sortBy (comparing f) $ jtxns $ filterJournalTransac
|
||||
f = transactionDateFn opts
|
||||
j' = journalSelectingAmountFromOpts opts j
|
||||
|
||||
-- | Select transactions for an entries report.
|
||||
entriesReport2 :: ReportOpts -> Query -> Journal -> EntriesReport
|
||||
entriesReport2 opts q j =
|
||||
sortBy (comparing f) $ filter (not . null . tpostings) $ map (filterTransactionPostings q) $ jtxns j'
|
||||
where
|
||||
f = transactionDateFn opts
|
||||
j' = journalSelectingAmountFromOpts opts j
|
||||
|
||||
tests_entriesReport2 = [
|
||||
"entriesReport2" ~: do
|
||||
assertEqual "" [] (entriesReport2 defreportopts Any nulljournal)
|
||||
]
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
-- | A postings report is a list of postings with a running total, a label
|
||||
@ -594,7 +607,8 @@ isInterestingIndented opts l a
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
tests_Hledger_Reports :: Test
|
||||
tests_Hledger_Reports = TestList
|
||||
tests_Hledger_Reports = TestList $
|
||||
tests_entriesReport2 ++
|
||||
[
|
||||
|
||||
"summarisePostingsByInterval" ~: do
|
||||
|
@ -42,8 +42,7 @@ import Hledger.Cli.Version
|
||||
tests_Hledger_Cli :: Test
|
||||
tests_Hledger_Cli = TestList
|
||||
[
|
||||
tests_Hledger_Data
|
||||
,tests_Hledger_Read
|
||||
tests_Hledger
|
||||
-- ,tests_Hledger_Cli_Add
|
||||
-- ,tests_Hledger_Cli_Balance
|
||||
,tests_Hledger_Cli_Balancesheet
|
||||
|
Loading…
Reference in New Issue
Block a user