From: Collin Funk Date: Sat, 1 Nov 2025 04:14:54 +0000 (-0700) Subject: tests: date: avoid test failure on NetBSD X-Git-Tag: v9.9~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6d273604d0a76cc40dbd0e8606a95b33a0275397;p=thirdparty%2Fcoreutils.git tests: date: avoid test failure on NetBSD * tests/date/date-tz.sh: Allow date to fail with large values for TZ since NetBSD's tzalloc function limits them to 256 bytes. --- diff --git a/tests/date/date-tz.sh b/tests/date/date-tz.sh index 5390cf5680..05736f90dc 100755 --- a/tests/date/date-tz.sh +++ b/tests/date/date-tz.sh @@ -21,6 +21,12 @@ print_ver_ date # coreutils-8.27 would overwrite the heap with large TZ values tz_long=$(printf '%2000s' | tr ' ' a) -date -d "TZ=\"${tz_long}0\" 2017" || fail=1 +date -d "TZ=\"${tz_long}0\" 2017" 2> err + +# Gnulib's tzalloc handles arbitrarily long TZ values, but NetBSD's does not. +case $? in + 0) ;; + *) grep '^date: invalid date' err || fail=1 ;; +esac Exit $fail