Closed trofi closed 3 years ago
On hledger-lib-1.21
test
it "ignores amount presentation" $ do
let a1 = (HL.eur 0.5) { HL.astyle = HL.amountstyle}
-- We use 'read' in the following because hledger-lib 1.19 changed the
-- type of 'asprecision' from Int to 'AmountPrecision'. 'read' works in
-- both cases.
a2 = (HL.eur 0.5) { HL.astyle = HL.amountstyle { HL.asprecision = read "15"} }
p1 = mkPosting ("Test", -1)
p2 = HL.nullposting { HL.paccount = "Toast", HL.pamount = HL.Mixed [a1] }
p3 = HL.nullposting { HL.paccount = "Toast", HL.pamount = HL.Mixed [a2] }
t0 = mkTransaction ((2017,9,23), "Test", [])
t1 = t0 { HL.tpostings = [p1,p2,p2] }
t2 = t0 { HL.tpostings = [p1,p3,p3] }
isDuplicateTransaction (HL.addTransaction t1 HL.nulljournal) t2 `shouldBe` True
fails on read "15"
.
Smaller reproducer:
$ ghci
GHCi, version 8.10.4: https://www.haskell.org/ghc/ :? for help
Prelude> read "15" :: Hledger.AmountPrecision
*** Exception: Prelude.read: no parse
Thanks for the report. This has already been fixed in master and I will cut a new release for it today
See #52
Thank you! Completely forgot to check master branch.
Full
build.log
: