fix doctest breakage (#1312)
This commit is contained in:
		
							parent
							
								
									f2dcbd2fee
								
							
						
					
					
						commit
						b76caae338
					
				@ -61,19 +61,21 @@ modifyTransactions d tmods ts = do
 | 
				
			|||||||
-- Currently the only kind of modification possible is adding automated
 | 
					-- Currently the only kind of modification possible is adding automated
 | 
				
			||||||
-- postings when certain other postings are present.
 | 
					-- postings when certain other postings are present.
 | 
				
			||||||
--
 | 
					--
 | 
				
			||||||
-- >>> putStr $ showTransaction $ transactionModifierToFunction (TransactionModifier "" ["pong" `post` usd 2]) nulltransaction{tpostings=["ping" `post` usd 1]}
 | 
					-- >>> t = nulltransaction{tpostings=["ping" `post` usd 1]}
 | 
				
			||||||
 | 
					-- >>> test = either putStr (putStr.showTransaction) . fmap ($ t) . transactionModifierToFunction nulldate
 | 
				
			||||||
 | 
					-- >>> test $ TransactionModifier "" ["pong" `post` usd 2]
 | 
				
			||||||
-- 0000-01-01
 | 
					-- 0000-01-01
 | 
				
			||||||
--     ping           $1.00
 | 
					--     ping           $1.00
 | 
				
			||||||
--     pong           $2.00  ; generated-posting: =
 | 
					--     pong           $2.00  ; generated-posting: =
 | 
				
			||||||
-- <BLANKLINE>
 | 
					-- <BLANKLINE>
 | 
				
			||||||
-- >>> putStr $ showTransaction $ transactionModifierToFunction (TransactionModifier "miss" ["pong" `post` usd 2]) nulltransaction{tpostings=["ping" `post` usd 1]}
 | 
					-- >>> test $ TransactionModifier "miss" ["pong" `post` usd 2]
 | 
				
			||||||
-- 0000-01-01
 | 
					-- 0000-01-01
 | 
				
			||||||
--     ping           $1.00
 | 
					--     ping           $1.00
 | 
				
			||||||
-- <BLANKLINE>
 | 
					-- <BLANKLINE>
 | 
				
			||||||
-- >>> putStr $ showTransaction $ transactionModifierToFunction (TransactionModifier "ping" ["pong" `post` amount{aismultiplier=True, aquantity=3}]) nulltransaction{tpostings=["ping" `post` usd 2]}
 | 
					-- >>> test $ TransactionModifier "ping" ["pong" `post` amount{aismultiplier=True, aquantity=3}]
 | 
				
			||||||
-- 0000-01-01
 | 
					-- 0000-01-01
 | 
				
			||||||
--     ping           $2.00
 | 
					--     ping           $1.00
 | 
				
			||||||
--     pong           $6.00  ; generated-posting: = ping
 | 
					--     pong           $3.00  ; generated-posting: = ping
 | 
				
			||||||
-- <BLANKLINE>
 | 
					-- <BLANKLINE>
 | 
				
			||||||
--
 | 
					--
 | 
				
			||||||
transactionModifierToFunction :: Day -> TransactionModifier -> Either String (Transaction -> Transaction)
 | 
					transactionModifierToFunction :: Day -> TransactionModifier -> Either String (Transaction -> Transaction)
 | 
				
			||||||
 | 
				
			|||||||
@ -191,9 +191,6 @@ data QueryOpt = QueryOptInAcctOnly AccountName  -- ^ show an account register fo
 | 
				
			|||||||
-- >>> parseQuery nulldate "\"expenses:dining out\""
 | 
					-- >>> parseQuery nulldate "\"expenses:dining out\""
 | 
				
			||||||
-- Right (Acct "expenses:dining out",[])
 | 
					-- Right (Acct "expenses:dining out",[])
 | 
				
			||||||
--
 | 
					--
 | 
				
			||||||
-- >>> isLeft $ parseQuery nulldate "\"\""
 | 
					 | 
				
			||||||
-- True
 | 
					 | 
				
			||||||
--
 | 
					 | 
				
			||||||
parseQuery :: Day -> T.Text -> Either String (Query,[QueryOpt])
 | 
					parseQuery :: Day -> T.Text -> Either String (Query,[QueryOpt])
 | 
				
			||||||
parseQuery d s = do
 | 
					parseQuery d s = do
 | 
				
			||||||
  let termstrs = words'' prefixes s
 | 
					  let termstrs = words'' prefixes s
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user