From 54788b5670b1914061763b60a91d0842983ab428 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Fri, 28 May 2021 06:17:12 -0500 Subject: Teach xparsedate() to handle more whitespace. --- tests/date.test | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests') diff --git a/tests/date.test b/tests/date.test index 6aaf937e..dfcefb26 100644 --- a/tests/date.test +++ b/tests/date.test @@ -76,6 +76,8 @@ testing "TZ= @" "TZ='America/Los_Angeles' date -d 'TZ=\"GMT\" @1533427200'" "Sat # Test all supported UTC offset variants. testing "tz Z" \ "date -u -d 2020-08-01T12:34:56Z" "Sat Aug 1 12:34:56 UTC 2020\n" "" "" +testing "tz ' Z '" \ + "date -u -d '2020-08-01T12:34:56 Z '" "Sat Aug 1 12:34:56 UTC 2020\n" "" "" testing "tz -0800" \ "date -u -d 2020-08-01T12:34:56-0800" "Sat Aug 1 20:34:56 UTC 2020\n" "" "" testing "tz +0800" \ @@ -88,6 +90,9 @@ testing "tz +08" \ "date -u -d 2020-08-01T12:34:56+08" "Sat Aug 1 04:34:56 UTC 2020\n" "" "" testing "tz +008" \ "date -u -d 2020-08-01T12:34:56+008" "Sat Aug 1 12:26:56 UTC 2020\n" "" "" +testing "tz + 8 : 8 " \ + "date -u -d '2020-08-01T12:34:56 + 8 : 8 '" "Sat Aug 1 04:26:56 UTC 2020\n"\ + "" "" # Can we parse date's own output format? testing "round trip" 'TZ=$tz date -d "$(TZ=$tz date -d @1598476818)"' \ -- cgit v1.2.3