add a register command test
This commit is contained in:
		
							parent
							
								
									5f1bec0b60
								
							
						
					
					
						commit
						a56da854b3
					
				
							
								
								
									
										8
									
								
								Tests.hs
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								Tests.hs
									
									
									
									
									
								
							| @ -77,6 +77,7 @@ unittests = TestList [ | |||||||
| 
 | 
 | ||||||
| functests = TestList [ | functests = TestList [ | ||||||
|   balancecommandtests |   balancecommandtests | ||||||
|  |   ,registercommandtests | ||||||
|   ] |   ] | ||||||
| 
 | 
 | ||||||
| balancecommandtests = TestList [ | balancecommandtests = TestList [ | ||||||
| @ -179,6 +180,13 @@ balancecommandtests = TestList [ | |||||||
|     assertequal "" $ showBalanceReport [] ["-e"] l |     assertequal "" $ showBalanceReport [] ["-e"] l | ||||||
|  ] |  ] | ||||||
| 
 | 
 | ||||||
|  | registercommandtests = TestList [ | ||||||
|  |   "register does something" ~: | ||||||
|  |   do  | ||||||
|  |     l <- ledgerfromfile "sample.ledger" | ||||||
|  |     assertnotequal "" $ showTransactionsWithBalances [] [] l | ||||||
|  |   ] | ||||||
|  |    | ||||||
| -- | Assert a parsed thing equals some expected thing, or print a parse error. | -- | Assert a parsed thing equals some expected thing, or print a parse error. | ||||||
| assertparseequal :: (Show a, Eq a) => a -> (Either ParseError a) -> Assertion | assertparseequal :: (Show a, Eq a) => a -> (Either ParseError a) -> Assertion | ||||||
| assertparseequal expected parsed = either printParseError (assertequal expected) parsed | assertparseequal expected parsed = either printParseError (assertequal expected) parsed | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user