Re: [PATCH 1/2] pretty tests: simplify %aI/%cI date format test
- From
Beat Bolli <dev+git@drbeat.li>
- Date
- Apr 26, 2021, 21:22 UTC
- Message-ID
- <803b9a49-6d27-2792-faa2-d37886cb2151@drbeat.li>
- In-Reply-To
- <patch-1.2-4a90e4a141a-20210425T090506Z-avarab@gmail.com>
On 25.04.21 11:11, Ævar Arnfjörð Bjarmason wrote:
Show 25 quoted lines
> Change a needlessly complex test for the %aI/%cI date > formats (iso-strict) added in 466fb6742d7 (pretty: provide a strict > ISO 8601 date format, 2014-08-29) to instead use the same pattern used > to test %as/%cs since 0df621172d8 (pretty: provide short date format, > 2019-11-19). > > Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> > --- > t/t4205-log-pretty-formats.sh | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/t/t4205-log-pretty-formats.sh b/t/t4205-log-pretty-formats.sh > index cabdf7d57a0..0462115ac5c 100755 > --- a/t/t4205-log-pretty-formats.sh > +++ b/t/t4205-log-pretty-formats.sh > @@ -527,8 +527,7 @@ test_expect_success 'strbuf_utf8_replace() not producing NUL' ' > > # ISO strict date format > test_expect_success 'ISO and ISO-strict date formats display the same values' ' > - git log --format=%ai%n%ci | > - sed -e "s/ /T/; s/ //; s/..\$/:&/" >expected && > + git log --format=%ad%n%cd --date=iso-strict >expected && > git log --format=%aI%n%cI >actual && > test_cmp expected actual > '
LGTM.
I wonder if these format shortcut tests that now look so regular should be put into a loop with a few suitable loop parameters?
Cheers, Beat