update status tests
This commit is contained in:
		
							parent
							
								
									9735d583d1
								
							
						
					
					
						commit
						c2365c3541
					
				@ -1,60 +0,0 @@
 | 
			
		||||
# report cleared transactions only
 | 
			
		||||
#
 | 
			
		||||
bin/hledger -f- print --cleared
 | 
			
		||||
<<<
 | 
			
		||||
2010/1/1 x
 | 
			
		||||
  a  1
 | 
			
		||||
  b
 | 
			
		||||
 | 
			
		||||
2010/1/2 * x
 | 
			
		||||
  a  1
 | 
			
		||||
  b
 | 
			
		||||
 | 
			
		||||
2010/1/3 *
 | 
			
		||||
  a  1
 | 
			
		||||
  b
 | 
			
		||||
>>>
 | 
			
		||||
2010/01/02 * x
 | 
			
		||||
    a             1
 | 
			
		||||
    b            -1
 | 
			
		||||
 | 
			
		||||
2010/01/03 *
 | 
			
		||||
    a             1
 | 
			
		||||
    b            -1
 | 
			
		||||
 | 
			
		||||
>>>=0
 | 
			
		||||
 | 
			
		||||
# report uncleared transactions only
 | 
			
		||||
bin/hledger -f- print --uncleared
 | 
			
		||||
<<<
 | 
			
		||||
2010/1/1 x
 | 
			
		||||
  a  1
 | 
			
		||||
  b
 | 
			
		||||
 | 
			
		||||
2010/1/2 * x
 | 
			
		||||
  a  1
 | 
			
		||||
  b
 | 
			
		||||
 | 
			
		||||
2010/1/3 *
 | 
			
		||||
  a  1
 | 
			
		||||
  b
 | 
			
		||||
>>>
 | 
			
		||||
2010/01/01 x
 | 
			
		||||
    a             1
 | 
			
		||||
    b            -1
 | 
			
		||||
 | 
			
		||||
>>>=0
 | 
			
		||||
 | 
			
		||||
# we don't yet support cleared postings, except we should ignore the marker when parsing them
 | 
			
		||||
bin/hledger -f- balance --no-total
 | 
			
		||||
<<<
 | 
			
		||||
2010/1/1
 | 
			
		||||
  a    1
 | 
			
		||||
  *a   2
 | 
			
		||||
  * a  4
 | 
			
		||||
  b
 | 
			
		||||
 | 
			
		||||
>>>
 | 
			
		||||
                   7  a
 | 
			
		||||
                  -7  b
 | 
			
		||||
>>>=0
 | 
			
		||||
							
								
								
									
										76
									
								
								tests/status.test
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										76
									
								
								tests/status.test
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,76 @@
 | 
			
		||||
# filtering by transaction status
 | 
			
		||||
 | 
			
		||||
# 1. with --cleared, print shows cleared transactions only
 | 
			
		||||
bin/hledger -f- print --cleared
 | 
			
		||||
<<<
 | 
			
		||||
2010/1/1 x
 | 
			
		||||
  a  1
 | 
			
		||||
  b
 | 
			
		||||
 | 
			
		||||
2010/1/2 * x
 | 
			
		||||
  a  1
 | 
			
		||||
  b
 | 
			
		||||
 | 
			
		||||
2010/1/3 *
 | 
			
		||||
  a  1
 | 
			
		||||
  b
 | 
			
		||||
>>>
 | 
			
		||||
2010/01/02 * x
 | 
			
		||||
    a             1
 | 
			
		||||
    b            -1
 | 
			
		||||
 | 
			
		||||
2010/01/03 *
 | 
			
		||||
    a             1
 | 
			
		||||
    b            -1
 | 
			
		||||
 | 
			
		||||
>>>=0
 | 
			
		||||
 | 
			
		||||
# 2. with --uncleared, shows uncleared transactions only
 | 
			
		||||
bin/hledger -f- print --uncleared
 | 
			
		||||
<<<
 | 
			
		||||
2010/1/1 x
 | 
			
		||||
  a  1
 | 
			
		||||
  b
 | 
			
		||||
 | 
			
		||||
2010/1/2 * x
 | 
			
		||||
  a  1
 | 
			
		||||
  b
 | 
			
		||||
 | 
			
		||||
2010/1/3 *
 | 
			
		||||
  a  1
 | 
			
		||||
  b
 | 
			
		||||
>>>
 | 
			
		||||
2010/01/01 x
 | 
			
		||||
    a             1
 | 
			
		||||
    b            -1
 | 
			
		||||
 | 
			
		||||
>>>=0
 | 
			
		||||
 | 
			
		||||
# 2. can also have per-posting cleared status
 | 
			
		||||
bin/hledger -f- register --cleared
 | 
			
		||||
<<<
 | 
			
		||||
2012/1/1
 | 
			
		||||
  a  1
 | 
			
		||||
  *b  2
 | 
			
		||||
  * c  4
 | 
			
		||||
  d
 | 
			
		||||
>>>
 | 
			
		||||
2012/01/01                      b                                 2            2
 | 
			
		||||
                                c                                 4            6
 | 
			
		||||
>>>= 0
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# 3. also works with balance as shown, same as ledger. Hmm.
 | 
			
		||||
bin/hledger -f- balance --uncleared
 | 
			
		||||
<<<
 | 
			
		||||
2012/1/1
 | 
			
		||||
  a  1
 | 
			
		||||
  *b  2
 | 
			
		||||
  d
 | 
			
		||||
 | 
			
		||||
>>>
 | 
			
		||||
                   1  a
 | 
			
		||||
                  -3  d
 | 
			
		||||
--------------------
 | 
			
		||||
                  -2
 | 
			
		||||
>>>=0
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user