;journal: fix tests
This commit is contained in:
		
							parent
							
								
									b5c332dde3
								
							
						
					
					
						commit
						84165f5a0c
					
				| @ -977,7 +977,7 @@ tests_JournalReader = tests "JournalReader" [ | |||||||
| 
 | 
 | ||||||
|   ,test "defaultcommoditydirectivep" $ do |   ,test "defaultcommoditydirectivep" $ do | ||||||
|       assertParse defaultcommoditydirectivep "D $1,000.0\n" |       assertParse defaultcommoditydirectivep "D $1,000.0\n" | ||||||
|       assertParseError defaultcommoditydirectivep "D $1000\n" "please include a decimal separator" |       assertParseError defaultcommoditydirectivep "D $1000\n" "Please include a decimal point or decimal comma" | ||||||
| 
 | 
 | ||||||
|   ,tests "defaultyeardirectivep" [ |   ,tests "defaultyeardirectivep" [ | ||||||
|       test "1000" $ assertParse defaultyeardirectivep "Y 1000" -- XXX no \n like the others |       test "1000" $ assertParse defaultyeardirectivep "Y 1000" -- XXX no \n like the others | ||||||
|  | |||||||
| @ -115,7 +115,7 @@ $ hledger -f- bal -V -N | |||||||
| 
 | 
 | ||||||
| # TODO #749 | # TODO #749 | ||||||
| 
 | 
 | ||||||
| # 9. Here the amount is parsed as 1. I think (hope) no country uses space  | # 8. Here the amount is parsed as 1. I think (hope) no country uses space  | ||||||
| # for decimal point, so we should parse this as 1000. | # for decimal point, so we should parse this as 1000. | ||||||
| < | < | ||||||
| 2018-01-01 | 2018-01-01 | ||||||
| @ -123,7 +123,7 @@ $ hledger -f- bal -V -N | |||||||
| 
 | 
 | ||||||
| $ hledger -f- reg amt:1 | $ hledger -f- reg amt:1 | ||||||
| 
 | 
 | ||||||
| # 10. This commodity directive should complain about a missing decimal separator, | # 9. This commodity directive should complain about a missing decimal separator, | ||||||
| # which we now require. | # which we now require. | ||||||
| < | < | ||||||
| commodity 1 000  USD | commodity 1 000  USD | ||||||
| @ -132,10 +132,10 @@ commodity 1 000  USD | |||||||
|   (a)   USD1 000 |   (a)   USD1 000 | ||||||
| 
 | 
 | ||||||
| $ hledger -f- bal | $ hledger -f- bal | ||||||
| >2 /decimal separator/ | >2 /decimal point or decimal comma/ | ||||||
| >=1 | >=1 | ||||||
| 
 | 
 | ||||||
| # 11. After a space-grouped amount, a posting comment should parse. | # 10. After a space-grouped amount, a posting comment should parse. | ||||||
| < | < | ||||||
| 2018-01-01 | 2018-01-01 | ||||||
|   (a)   USD 1 000  ;comment |   (a)   USD 1 000  ;comment | ||||||
| @ -143,7 +143,7 @@ $ hledger -f- bal | |||||||
| $ hledger -f- print | $ hledger -f- print | ||||||
| > //    # any stdout, no stderr, 0 exit code | > //    # any stdout, no stderr, 0 exit code | ||||||
| 
 | 
 | ||||||
| # 12. After a space-grouped amount, trailing whitespace should parse. | # 11. After a space-grouped amount, trailing whitespace should parse. | ||||||
| < | < | ||||||
| 2018-01-01 | 2018-01-01 | ||||||
|   (a)   USD 1 000  |   (a)   USD 1 000  | ||||||
| @ -151,7 +151,7 @@ $ hledger -f- print | |||||||
| $ hledger -f- print | $ hledger -f- print | ||||||
| > //    # any stdout, no stderr, 0 exit code | > //    # any stdout, no stderr, 0 exit code | ||||||
| 
 | 
 | ||||||
| # 13. Example of surprising decimal mark parsing behaviour. | # 12. Example of surprising decimal mark parsing behaviour. | ||||||
| # Without a commodity declaration, these amounts are parsed as 10 and 10000. | # Without a commodity declaration, these amounts are parsed as 10 and 10000. | ||||||
| # < | # < | ||||||
| # 2000/1/1 | # 2000/1/1 | ||||||
|  | |||||||
| @ -130,7 +130,7 @@ commodity €1,000.00 | |||||||
| hledger bal -f - | hledger bal -f - | ||||||
| <<< | <<< | ||||||
| commodity 1000 EUR | commodity 1000 EUR | ||||||
| >>>2 /please include a decimal separator/ | >>>2 /Please include a decimal point or decimal comma/ | ||||||
| >>>=1 | >>>=1 | ||||||
| 
 | 
 | ||||||
| # 12. Commodity directive with zero precision | # 12. Commodity directive with zero precision | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user