Using "hledgerdev" was a hack to help ensure that tests used a fresh developer build by default. Now they specify "hledger" again, which fits better with stack. It's up to the tester to make sure the desired executable is first in PATH or specified with -w. (Note a couple of tests currently don't obey -w and will always run "hledger", see addons.test).
		
			
				
	
	
		
			75 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			75 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| # a default commodity defined with the D directive will be used for any
 | |
| # subsequent commodity-less posting amounts. The sample amount's display style
 | |
| # is also applied, and the resulting amount may end up setting the canonical
 | |
| # display style for the commodity.
 | |
| 
 | |
| # 1. no default commodity
 | |
| hledger -f- print
 | |
| <<<
 | |
| 2010/1/1
 | |
|   a  1000
 | |
|   b
 | |
| >>>
 | |
| 2010/01/01
 | |
|     a          1000
 | |
|     b         -1000
 | |
| 
 | |
| >>>=0
 | |
| 
 | |
| # 2. pound, two decimal places, no digit group separator
 | |
| hledger -f- print
 | |
| <<<
 | |
| D £1000.00
 | |
| 2010/1/1
 | |
|   a  1000
 | |
|   b
 | |
| >>>
 | |
| 2010/01/01
 | |
|     a      £1000.00
 | |
|     b     £-1000.00
 | |
| 
 | |
| >>>=0
 | |
| 
 | |
| # 3. dollar, comma decimal point, three decimal places, no digit group separator
 | |
| hledger -f- print
 | |
| <<<
 | |
| D $1,000
 | |
| 2010/1/1
 | |
|   a  1000
 | |
|   b
 | |
| >>>
 | |
| 2010/01/01
 | |
|     a     $1000,000
 | |
|     b    $-1000,000
 | |
| 
 | |
| >>>=0
 | |
| 
 | |
| # 4. dollar, three digit group separator, one decimal place
 | |
| hledger -f- print
 | |
| <<<
 | |
| D $1,000.0
 | |
| 2010/1/1
 | |
|   (a)  1000000
 | |
| >>>
 | |
| 2010/01/01
 | |
|     (a)  $1,000,000.0
 | |
| 
 | |
| >>>=0
 | |
| 
 | |
| # 5. commodity and display style applied to the second posting amount..
 | |
| # which ends up setting the digit group style, since it's the first amount
 | |
| # with digit groups. The great precision is used.
 | |
| hledger -f- print
 | |
| <<<
 | |
| D $1,000.0
 | |
| 2010/1/1
 | |
|   (a)  $1000000.00
 | |
|   (b)   1000000
 | |
| >>>
 | |
| 2010/01/01
 | |
|     (a)  $1,000,000.00
 | |
|     (b)  $1,000,000.00
 | |
| 
 | |
| >>>=0
 | |
| 
 |