Test daylight time for strflocaltime (#3323)

This test case covers the behavior described in issue #1912, fixed by #3203.
This commit is contained in:
Steven Ihde authored and GitHub committed 2025-05-15 07:16:25 +09:00
1 parent 931a362f8b
commit 77d23e9a5f
1 file changed
+7
+7
View File
@@ -728,6 +728,13 @@ if ! $msys && ! $mingw; then
exit 1 exit 1
fi fi
# Test when DST is in effect: #1912
if ! r=$(TZ=Europe/Paris $JQ -rn '1750500000 | strflocaltime("%F %T %z %Z")') \
|| [ "$r" != "2025-06-21 12:00:00 +0200 CEST" ]; then
echo "Incorrectly formatted local time"
exit 1
fi
if ! r=$(TZ=Europe/Paris $JQ -rn '1731627341 | strftime("%F %T %z %Z")') \ if ! r=$(TZ=Europe/Paris $JQ -rn '1731627341 | strftime("%F %T %z %Z")') \
|| ( [ "$r" != "2024-11-14 23:35:41 +0000 UTC" ] \ || ( [ "$r" != "2024-11-14 23:35:41 +0000 UTC" ] \
&& [ "$r" != "2024-11-14 23:35:41 +0000 GMT" ] ); then && [ "$r" != "2024-11-14 23:35:41 +0000 GMT" ] ); then