- use new query system for command line too, filterspec is no more - move unit tests near the code they test, run them in bottom up order, add more - more precise Show instances, used for debugging not ui
		
			
				
	
	
		
			33 lines
		
	
	
		
			650 B
		
	
	
	
		
			Haskell
		
	
	
	
	
	
			
		
		
	
	
			33 lines
		
	
	
		
			650 B
		
	
	
	
		
			Haskell
		
	
	
	
	
	
{-|
 | 
						|
 | 
						|
An 'Account' stores
 | 
						|
 | 
						|
- an 'AccountName',
 | 
						|
 | 
						|
- all 'Posting's in the account, excluding subaccounts
 | 
						|
 | 
						|
- a 'MixedAmount' representing the account balance, including subaccounts.
 | 
						|
 | 
						|
-}
 | 
						|
 | 
						|
module Hledger.Data.Account
 | 
						|
where
 | 
						|
import Test.HUnit
 | 
						|
import Text.Printf
 | 
						|
 | 
						|
import Hledger.Data.Amount
 | 
						|
import Hledger.Data.Types
 | 
						|
 | 
						|
 | 
						|
instance Show Account where
 | 
						|
    show (Account a ps b) = printf "Account %s with %d postings and %s balance" a (length ps) (showMixedAmountDebug b)
 | 
						|
 | 
						|
instance Eq Account where
 | 
						|
    (==) (Account n1 t1 b1) (Account n2 t2 b2) = n1 == n2 && t1 == t2 && b1 == b2
 | 
						|
 | 
						|
nullacct = Account "" [] nullmixedamt
 | 
						|
 | 
						|
tests_Hledger_Data_Account = TestList [
 | 
						|
 ]
 | 
						|
 |