git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] t0006: add more tests with a negative TZ offset

From
Beat Bolli <dev+git@drbeat.li>
Date
Mar 14, 2024, 08:55 UTC
Message-ID
<20240314085512.1827031-1-dev+git@drbeat.li>

This test doesn't systematically check a negative timezone offset. Add a test for each format that outputs the offset to improve our test coverage.

Signed-off-by: Beat Bolli <dev+git@drbeat.li>
---
 t/t0006-date.sh | 8 ++++++++
 1 file changed, 8 insertions(+)
diff --git a/t/t0006-date.sh b/t/t0006-date.sh
index 1d228a981e..3031256d14 100755
--- a/t/t0006-date.sh
+++ b/t/t0006-date.sh
@@ -70,6 +70,14 @@ check_show 'format:%s' '123456789 +1234' 123456789
 check_show 'format:%s' '123456789 -1234' 123456789
 check_show 'format-local:%s' '123456789 -1234' 123456789
 
+# negative TZ offset
+TIME='1466000000 -0200'
+check_show iso8601 "$TIME" '2016-06-15 12:13:20 -0200'
+check_show iso8601-strict "$TIME" '2016-06-15T12:13:20-02:00'
+check_show rfc2822 "$TIME" 'Wed, 15 Jun 2016 12:13:20 -0200'
+check_show default "$TIME" 'Wed Jun 15 12:13:20 2016 -0200'
+check_show raw "$TIME" '1466000000 -0200'
+
 # arbitrary time absurdly far in the future
 FUTURE="5758122296 -0400"
 check_show iso       "$FUTURE" "2152-06-19 18:24:56 -0400" TIME_IS_64BIT,TIME_T_IS_64BIT
-- 
2.42.0.583.ga47b40fd90
Message 1 of 1 in “t0006: add more tests with a negative TZ offset”
  1. t0006: add more tests with a negative TZ offsetBeat Bolli, Mar 14, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.