From 7092ef9a8973cac51cba853e04885d5ab285bbdb Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Fri, 25 Mar 2022 19:41:02 -1000 Subject: [PATCH] fix: commented test for #1849 --- hledger/test/forecast.test | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/hledger/test/forecast.test b/hledger/test/forecast.test index c54e0b94e..09a9a1e3c 100644 --- a/hledger/test/forecast.test +++ b/hledger/test/forecast.test @@ -347,16 +347,30 @@ $ hledger -f - reg --forecast -H # 21. Only today's date (or a Y year declaration) affects relative dates; # an explicit report period or forecast period does not. (#1845) # More explanation: -# - "next quarter" is a relative date meaning "next quarter after the 1st of the current year". -# - XXX it should probably be "after today", this has been affected by #1677's https://github.com/simonmichael/hledger/commit/0f205295e806fccbfce0adbbff0e0ea6dd9f51d8#diff-fcee3c006b1d2e35b8c279c9daa9963ecdb5910bdc90099f7b3a37b8b529a65dR320 +# - "next quarter" is a relative date meaning "next quarter after the 1st of the current year" (a bug, see 21b). # - Current year is 2021 (because --today sets the current day to be in 2021, for a repeatable test). # - Neither the start or end year of the report or forecast periods (2020, 2022) are used. < ~ quarterly from next quarter (a) 1 - $ hledger -f- --today=2021-05-01 reg --period=2020-2022 --forecast=2020-2022 2021-04-01 (a) 1 1 2021-07-01 (a) 1 2 2021-10-01 (a) 1 3 >=0 + +# 21b. Only a Y year declaration, or today's date, affects relative dates; +# the report period or forecast period do not (#1845). +# Also, without Y, relative dates should be relative to "today" (#1843, #1849). +# Explanation of the below: "next quarter" is a relative date. +# There's no Y, so it's relative to "today", which here is set to 2021-05-01 +# with --today for repeatability. The "recurrence period" begins with the first +# quarter after that, ie 2021-07-01. The report and forecast periods' +# start/end dates (2020, 2022) do not affect the relative date. +# < +# ~ quarterly from next quarter +# (a) 1 +# $ hledger -f- --today=2021-05-01 reg --period=2020-2022 --forecast=2020-2022 +# 2021-07-01 (a) 1 2 +# 2021-10-01 (a) 1 3 +# >=0