File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -665,6 +665,7 @@ $VALGRIND $Q $JQ . <<\NUM
665
665
-10E-1000000001
666
666
NUM
667
667
668
+ <<< <<< < Side # 1 (Conflict 1 of 1)
668
669
# test for --indent and --compact-output -- #1465
669
670
printf ' [1,2]\n' > $d /expected
670
671
$JQ --compact-output -n " [1,2]" > $d /out
@@ -694,4 +695,26 @@ printf '[\n {\n "a": 1\n }\n]\n' > $d/expected
694
695
$JQ --indent 6 -n " [{a:1}]" > $d /out
695
696
cmp $d /out $d /expected
696
697
698
+ if ! $msys && ! $mingw ; then
699
+ # Test handling of timezones -- #2429, #2475
700
+ if ! r=$( TZ=Asia/Tokyo $JQ -rn ' 1731627341 | strflocaltime("%F %T %z %Z")' ) \
701
+ || [ " $r " != " 2024-11-15 08:35:41 +0900 JST" ]; then
702
+ echo " Incorrectly formatted local time"
703
+ exit 1
704
+ fi
705
+
706
+ if ! r=$( TZ=Europe/Paris $JQ -rn ' 1731627341 | strflocaltime("%F %T %z %Z")' ) \
707
+ || [ " $r " != " 2024-11-15 00:35:41 +0100 CET" ]; then
708
+ echo " Incorrectly formatted local time"
709
+ exit 1
710
+ fi
711
+
712
+ if ! r=$( TZ=Europe/Paris $JQ -rn ' 1731627341 | strftime("%F %T %z %Z")' ) \
713
+ || ( [ " $r " != " 2024-11-14 23:35:41 +0000 UTC" ] \
714
+ && [ " $r " != " 2024-11-14 23:35:41 +0000 GMT" ] ); then
715
+ echo " Incorrectly formatted universal time"
716
+ exit 1
717
+ fi
718
+ fi
719
+
697
720
exit 0
You can’t perform that action at this time.
0 commit comments