Merge branch 'ab/pretty-date-format-tests'

Tweak a few tests for "log --format=..." that show timestamps in
various formats.

* ab/pretty-date-format-tests:
  pretty tests: give --date/format tests a better description
  pretty tests: simplify %aI/%cI date format test
This commit is contained in:
Junio C Hamano 2021-05-07 12:47:37 +09:00
commit e5d99d378b

View File

@ -525,15 +525,14 @@ test_expect_success 'strbuf_utf8_replace() not producing NUL' '
! grep Q actual ! grep Q actual
' '
# ISO strict date format # --date=[XXX] and corresponding %a[X] %c[X] format equivalency
test_expect_success 'ISO and ISO-strict date formats display the same values' ' test_expect_success '--date=iso-strict %ad%cd is the same as %aI%cI' '
git log --format=%ai%n%ci | git log --format=%ad%n%cd --date=iso-strict >expected &&
sed -e "s/ /T/; s/ //; s/..\$/:&/" >expected &&
git log --format=%aI%n%cI >actual && git log --format=%aI%n%cI >actual &&
test_cmp expected actual test_cmp expected actual
' '
test_expect_success 'short date' ' test_expect_success '--date=short %ad%cd is the same as %as%cs' '
git log --format=%ad%n%cd --date=short >expected && git log --format=%ad%n%cd --date=short >expected &&
git log --format=%as%n%cs >actual && git log --format=%as%n%cs >actual &&
test_cmp expected actual test_cmp expected actual