pricing, print tests
This commit is contained in:
		
							parent
							
								
									d83f6ba5e0
								
							
						
					
					
						commit
						5083255ed3
					
				
							
								
								
									
										51
									
								
								tests/pricing.tests
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										51
									
								
								tests/pricing.tests
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,51 @@ | ||||
| # draft pricing tests | ||||
| # 1. print a transaction with explicitly-priced amount | ||||
| ./hledger -f- print | ||||
| <<< | ||||
| 2009/1/2 x | ||||
|      expenses:foreign currency       €100 @ $1.35 | ||||
|      assets | ||||
| >>> | ||||
| 2009/01/02 x | ||||
|     expenses:foreign currency  €100 @ $1.35 | ||||
|     assets                         $-135.00 | ||||
| 
 | ||||
| # 2. again, this time converting to cost basis | ||||
| ./hledger -f- print -B | ||||
| <<< | ||||
| 2009/1/2 x | ||||
|      expenses:foreign currency       €100 @ $1.35 | ||||
|      assets | ||||
| >>> | ||||
| 2009/01/02 x | ||||
|     expenses:foreign currency       $135.00 | ||||
|     assets                         $-135.00 | ||||
| 
 | ||||
| # 3. same as above, but using a historical price directive | ||||
| ./hledger -f- print | ||||
| <<< | ||||
| P 2009/1/1 € $1.35 | ||||
| 
 | ||||
| 2009/1/2 x | ||||
|      expenses:foreign currency       €100 | ||||
|      assets | ||||
| 
 | ||||
| >>> | ||||
| 2009/01/02 x | ||||
|     expenses:foreign currency  €100 @ $1.35 | ||||
|     assets                     €-100 @ $1.35 | ||||
| 
 | ||||
| # 4. and with conversion | ||||
| ./hledger -f- print -B | ||||
| <<< | ||||
| P 2009/1/1 € $1.35 | ||||
| 
 | ||||
| 2009/1/2 x | ||||
|      expenses:foreign currency       €100 | ||||
|      assets | ||||
| 
 | ||||
| >>> | ||||
| 2009/01/02 x | ||||
|     expenses:foreign currency       $135.00 | ||||
|     assets                         $-135.00 | ||||
| 
 | ||||
							
								
								
									
										7
									
								
								tests/print-acct-pattern.test
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								tests/print-acct-pattern.test
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,7 @@ | ||||
| # print with negative account pattern should exclude transactions containing a matched posting | ||||
| hledger -f- print not:a | ||||
| <<< | ||||
| 2010/1/1 x | ||||
|   a   1 | ||||
|   b  -1 | ||||
| >>> | ||||
							
								
								
									
										15
									
								
								tests/print-desc-pattern.test
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								tests/print-desc-pattern.test
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,15 @@ | ||||
| ./hledger -f - print desc:x | ||||
| <<< | ||||
| 2009/1/1 x | ||||
|     a  1 | ||||
|     b | ||||
| 
 | ||||
| 2009/1/1 y | ||||
|     a  1 | ||||
|     b | ||||
| 
 | ||||
| >>> | ||||
| 2009/01/01 x | ||||
|     a             1 | ||||
|     b            -1 | ||||
| 
 | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user