Skip to content

Commit

Permalink
;journal: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
simonmichael committed Mar 18, 2020
1 parent b5c332d commit 84165f5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion hledger-lib/Hledger/Read/JournalReader.hs
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,7 @@ tests_JournalReader = tests "JournalReader" [

,test "defaultcommoditydirectivep" $ do
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" [
test "1000" $ assertParse defaultyeardirectivep "Y 1000" -- XXX no \n like the others
Expand Down
14 changes: 7 additions & 7 deletions tests/journal/amounts-and-commodities.test
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,15 @@ $ hledger -f- bal -V -N

# 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.
<
2018-01-01
(a) USD1 000

$ 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.
<
commodity 1 000 USD
Expand All @@ -132,26 +132,26 @@ commodity 1 000 USD
(a) USD1 000

$ hledger -f- bal
>2 /decimal separator/
>2 /decimal point or decimal comma/
>=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
(a) USD 1 000 ;comment

$ hledger -f- print
> // # 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
(a) USD 1 000

$ hledger -f- print
> // # 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.
# <
# 2000/1/1
Expand All @@ -162,4 +162,4 @@ $ hledger -f- print
# could not balance this transaction (real postings are off by $9,990,000)
# 2000-01-01
# a $-10,000
# b $10,000,000
# b $10,000,000
2 changes: 1 addition & 1 deletion tests/journal/numbers.test
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ commodity €1,000.00
hledger bal -f -
<<<
commodity 1000 EUR
>>>2 /please include a decimal separator/
>>>2 /Please include a decimal point or decimal comma/
>>>=1

# 12. Commodity directive with zero precision
Expand Down

0 comments on commit 84165f5

Please sign in to comment.