Subject: bug#62420: closed (Re: bug#62420: 29.0.60; fns-tests-collate-strings fails on Cygwin)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 25 Mar 2023 14:29:02 +0000

Your bug report

#62420: 29.0.60; fns-tests-collate-strings fails on Cygwin

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
62420: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=62420
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#62420: 29.0.60; fns-tests-collate-strings fails on Cygwin
From: Ken Brown <[email-masked]>
To: Eli Zaretskii <[email-masked]>
Cc: [email-masked]
Date: Sat, 25 Mar 2023 10:27:51 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

On 3/25/2023 8:24 AM, Eli Zaretskii wrote:
>> Date: Fri, 24 Mar 2023 10:52:45 -0400
>> From: Ken Brown <[email-masked]>
>> Is this OK for the emacs-29 branch?
> 
> Yes, thanks.
> 
>> [Note: The test will still fail on current Cygwin after this patch; but
>> that's because of a bug in Cygwin, which has been fixed in the
>> development sources for Cygwin 3.5.]
> 
> Maybe mention this in comments?

Done.

>  Bonus points for making it an
> expected failure for Cygwin < 3.5, assuming the version of Cygwin
> could be obtained by the test code.

I don't know how to get the version in Lisp.  I only know how to get it 
in C, using uname.  If someone can tell me how to get it in Lisp, I'll 
try to earn the bonus points.

Closing.

Ken

Subject: 29.0.60; fns-tests-collate-strings fails on Cygwin
From: Ken Brown <[email-masked]>
To: [email-masked]
Date: Fri, 24 Mar 2023 10:52:45 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

The test in the subject fails on Cygwin as follows:

Test fns-tests-collate-strings condition:
     (ert-test-failed
      ((should-error
        (string-collate-equalp "xyzzy" "xyzzy" "en_DE.UTF-8"))
       :form
       (string-collate-equalp "xyzzy" "xyzzy" "en_DE.UTF-8")
       :value t :fail-reason "did not signal an error"))

The reason is that en_DE.UTF-8 is actually a valid locale on Cygwin.
[Cygwin gets its locale information from Windows.  The latter supports
the RFC 5646 locale "en-DE", which is called "English (Germany)" in the
"Region" settings.]

The following trivial patch fixes the problem:

--- a/test/src/fns-tests.el
+++ b/test/src/fns-tests.el
@@ -254,7 +254,7 @@ fns-tests-collate-strings
    (should (string-collate-equalp "xyzzy" "XYZZY" nil t))
     ;; Locale must be valid.
-  (should-error (string-collate-equalp "xyzzy" "xyzzy" "en_DE.UTF-8")))
+  (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

Is this OK for the emacs-29 branch?

[Note: The test will still fail on current Cygwin after this patch; but
that's because of a bug in Cygwin, which has been fixed in the
development sources for Cygwin 3.5.]

Ken