fix: commented test for #1849

This commit is contained in:
Simon Michael 2022-03-25 19:41:02 -10:00
parent bffb6c8c82
commit 7092ef9a89

View File

@ -347,16 +347,30 @@ $ hledger -f - reg --forecast -H
# 21. Only today's date (or a Y year declaration) affects relative dates; # 21. Only today's date (or a Y year declaration) affects relative dates;
# an explicit report period or forecast period does not. (#1845) # an explicit report period or forecast period does not. (#1845)
# More explanation: # More explanation:
# - "next quarter" is a relative date meaning "next quarter after the 1st of the current year". # - "next quarter" is a relative date meaning "next quarter after the 1st of the current year" (a bug, see 21b).
# - XXX it should probably be "after today", this has been affected by #1677's https://github.com/simonmichael/hledger/commit/0f205295e806fccbfce0adbbff0e0ea6dd9f51d8#diff-fcee3c006b1d2e35b8c279c9daa9963ecdb5910bdc90099f7b3a37b8b529a65dR320
# - Current year is 2021 (because --today sets the current day to be in 2021, for a repeatable test). # - 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. # - Neither the start or end year of the report or forecast periods (2020, 2022) are used.
< <
~ quarterly from next quarter ~ quarterly from next quarter
(a) 1 (a) 1
$ hledger -f- --today=2021-05-01 reg --period=2020-2022 --forecast=2020-2022 $ hledger -f- --today=2021-05-01 reg --period=2020-2022 --forecast=2020-2022
2021-04-01 (a) 1 1 2021-04-01 (a) 1 1
2021-07-01 (a) 1 2 2021-07-01 (a) 1 2
2021-10-01 (a) 1 3 2021-10-01 (a) 1 3
>=0 >=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