]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: fix false failure with dash
authorPádraig Brady <P@draigBrady.com>
Fri, 17 Apr 2026 12:17:56 +0000 (13:17 +0100)
committerPádraig Brady <P@draigBrady.com>
Fri, 17 Apr 2026 12:24:46 +0000 (13:24 +0100)
* tests/date/date-locale-hour.sh: Just strip the char before the last x,
assuming it's going to be the newline output by `locale`.
dash doesn't support $'' within ${}.

tests/date/date-locale-hour.sh

index a368fb77d782ec1e0c9bd891e4b5b241242fe65d..749123d853c2f2462d28aa98e72e430d93ae9045 100755 (executable)
@@ -60,7 +60,7 @@ done
 # and that it uses it by default when no format string is given.
 for loc in $(locale -a | shuf -n 10); do
   fmt="$(LC_ALL=$loc locale date_fmt; printf x)"
-  fmt=${fmt%$'\n'x}  # Retain fmt newlines (seen with Serbian on Centos 7)
+  fmt=${fmt%?x}  # Retain fmt newlines (seen with Serbian on Centos 7)
   if test -n "$fmt"; then
     LC_ALL=$loc date -d '2025-10-11T13:00' +"$fmt" > $loc.exp || fail=1
     LC_ALL=$loc date -d '2025-10-11T13:00' > $loc.out || fail=1