]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
date: port test to NetBSD 10
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 10 Jun 2025 19:51:05 +0000 (12:51 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 10 Jun 2025 20:03:40 +0000 (13:03 -0700)
Problem reported by Collin Funk in:
https://lists.gnu.org/r/bug-gnulib/2025-06/msg00094.html
* tests/date/date-debug.sh: Also allow NetBSD 10 mktime behavior.
Although NetBSD contradicts POSIX, POSIX is likely wrong here and
I vaguely recall that there’s a POSIX correction in progress
that will allow the NetBSD behavior.

tests/date/date-debug.sh

index b63ae315b204ac7a12c28d7a2de5f5edf7586642..ee522f2b7bb645a2943427097446231705695d20 100755 (executable)
@@ -75,8 +75,6 @@ date: input timezone: TZ="America/Edmonton" in date string
 date: using specified time as starting value: '02:30:00'
 date: error: invalid date/time value:
 date:     user provided time: '(Y-M-D) 2006-04-02 02:30:00'
-date:        normalized time: '(Y-M-D) 2006-04-02 XX:XX:XX'
-date:                                             --
 date:      possible reasons:
 date:        nonexistent due to daylight-saving time;
 date:        invalid day/month combination;
@@ -90,7 +88,12 @@ returns_ 1 date --debug -d "$in2" >out2-t 2>&1 || fail=1
 # The output line of "normalized time" can differ between systems
 # (e.g. glibc vs musl) and should not be checked.
 # See: https://lists.gnu.org/archive/html/coreutils/2019-05/msg00039.html
-sed '/normalized time:/s/ [0-9][0-9]:[0-9][0-9]:[0-9][0-9]/ XX:XX:XX/' \
+sed '
+      /^date: *normalized time:/d
+      /^date: *time could not be normalized/d
+      /^date: *--*$/d
+      /^date: *numeric values overflow;$/d
+    ' \
     out2-t > out2 || framework_failure_
 
 compare exp2 out2 || fail=1