From ec243a1bea66101cee78553589a12ea25355c9c2 Mon Sep 17 00:00:00 2001 From: Julien Moutinho Date: Thu, 7 Aug 2014 17:47:21 +0200 Subject: [PATCH] data: fix unit test by ignoring sourcepos --- hledger/Hledger/Cli.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hledger/Hledger/Cli.hs b/hledger/Hledger/Cli.hs index 68e938b99..9961a1245 100644 --- a/hledger/Hledger/Cli.hs +++ b/hledger/Hledger/Cli.hs @@ -63,8 +63,9 @@ tests_Hledger_Cli = TestList ,"account directive" ~: - let sameParse str1 str2 = do j1 <- readJournal Nothing Nothing True Nothing str1 >>= either error' return - j2 <- readJournal Nothing Nothing True Nothing str2 >>= either error' return + let ignoresourcepos j = j{jtxns=map (\t -> t{tsourcepos=nullsourcepos}) (jtxns j)} in + let sameParse str1 str2 = do j1 <- readJournal Nothing Nothing True Nothing str1 >>= either error' (return . ignoresourcepos) + j2 <- readJournal Nothing Nothing True Nothing str2 >>= either error' (return . ignoresourcepos) j1 `is` j2{filereadtime=filereadtime j1, files=files j1, jContext=jContext j1} in TestList [