Re: [PATCH 3/3] t0006-date.sh: add `human` date format tests.
- From
Philip Oakley <philipoakley@iee.org>
- Date
- Jan 3, 2019, 21:14 UTC
- Message-ID
- <a5412274-028f-3662-e4f5-dbbcad4d9a40@iee.org>
- In-Reply-To
- <xmqqva37j595.fsf@gitster-ct.c.googlers.com>
On 02/01/2019 18:15, Junio C Hamano wrote:
Show 17 quoted lines
> We perhaps can use "test-tool date timestamp", like so
>
> check_human_date $(test-tool date timestamp "18000 seconds ago") ...
>
> or moving the part that munges 18000 into the above form inside
> check_human_date helper function, e.g.
>
> check_human_date () {
> commit_date=$(test-tool date timestamp "$1 seconds ago")
> commit_date="$commit_date +0200"
> expect=$2
> ...
> }
>
> which would let us write
>
> check_human_date 432000" $THIS_YEAR_REGEX # 5 days agoJust a quick bikeshed: if used, would this have a year end 5 day roll-over error potential, or will it always use the single date?
(I appreciate it is just suggestion code, not tested)
-- Philip