Subject: bug#76550: 30.1; Test failure for fns-tests-collate-strings with musl libc

From: Ulrich Müller <[email-masked]>
Date: Tue, 25 Feb 2025 17:06:04 +0100

Would attached patch be acceptable as a fix?

>From 403191534a1dda4e396ae05dd8a34c3230e9a7fb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ulrich=20M=C3=BCller?= <[email-masked]>
Date: Tue, 25 Feb 2025 17:03:02 +0100
Subject: [PATCH] ; Fix fns-tests.el with musl libc

* test/src/fns-tests.el (fns-tests-collate-strings): Don't test
for valid locale with musl libc.  (Bug#76550)
---
 test/src/fns-tests.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/test/src/fns-tests.el b/test/src/fns-tests.el
index 9e134c24e05..f15896cfd57 100644
--- a/test/src/fns-tests.el
+++ b/test/src/fns-tests.el
@@ -277,7 +277,9 @@ fns-tests-collate-strings
   (should (string-collate-equalp "xyzzy" "XYZZY" nil t))
 
   ;; Locale must be valid.
-  (should-error (string-collate-equalp "xyzzy" "xyzzy" "en_XY.UTF-8")))
+  ;; musl's newlocale(3) is lenient about locale validation (bug#76550).
+  (unless (string-match-p "-musl" system-configuration)
+    (should-error (string-collate-equalp "xyzzy" "xyzzy" "en_XY.UTF-8"))))
 
 ;; There must be a check for valid codepoints.  (Check not implemented yet)
 ;  (should-error
-- 
2.48.1