From fc11b5130f03b6f957360723c5956fe368074fdf Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Sat, 18 Aug 2018 19:49:43 +0100 Subject: [PATCH] journal: another failing test from #807 --- hledger-lib/Hledger/Read/JournalReader.hs | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/hledger-lib/Hledger/Read/JournalReader.hs b/hledger-lib/Hledger/Read/JournalReader.hs index 72e232e2c..e6463f38e 100644 --- a/hledger-lib/Hledger/Read/JournalReader.hs +++ b/hledger-lib/Hledger/Read/JournalReader.hs @@ -816,8 +816,9 @@ tests_Hledger_Read_JournalReader = TestList $ concat [ easytests = tests "JournalReader" [ tests "periodictransactionp" [ - test "more-period-text-in-comment" $ expectParseEqIO periodictransactionp - "~ monthly from 2018/6 ;In 2019 we will change this\n" + -- tests from #807 + test "more-period-text-in-comment-after-one-space" $ expectParseEqIO periodictransactionp + "~ monthly from 2018/6 ;In 2019 we will change this\n" nullperiodictransaction { ptperiodexpr = "monthly from 2018/6" ,ptinterval = Months 1 @@ -829,7 +830,7 @@ easytests = tests "JournalReader" [ ,pttags = [] ,ptpostings = [] } - ,_test "more-period-text-in-description-after-two-spaces" $ expectParseEqIO periodictransactionp + ,_test "more-period-text-in-description-after-two-spaces" $ expectParseEqIO periodictransactionp -- TODO "~ monthly from 2018/6 In 2019 we will change this\n" nullperiodictransaction { ptperiodexpr = "monthly from 2018/6" @@ -837,7 +838,7 @@ easytests = tests "JournalReader" [ ,ptspan = DateSpan (Just $ parsedate "2018/06/01") Nothing ,ptdescription = "In 2019 we will change this\n" } - ,_test "more-period-text-in-description-after-one-space" $ expectParseEqIO periodictransactionp + ,_test "more-period-text-in-description-after-one-space" $ expectParseEqIO periodictransactionp -- TODO "~ monthly from 2018/6 In 2019 we will change this\n" nullperiodictransaction { ptperiodexpr = "monthly from 2018/6" @@ -845,6 +846,13 @@ easytests = tests "JournalReader" [ ,ptspan = DateSpan (Just $ parsedate "2018/06/01") Nothing ,ptdescription = "In 2019 we will change this\n" } - -- TODO any more cases from https://github.com/simonmichael/hledger/pull/807#issuecomment-396994403 ? + ,_test "Next-year-in-description" $ expectParseEqIO periodictransactionp -- TODO + "~ monthly Next year blah blah\n" + nullperiodictransaction { + ptperiodexpr = "monthly" + ,ptinterval = Months 1 + ,ptspan = DateSpan Nothing Nothing + ,ptdescription = "Next year blah blah\n" + } ] ]