all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#62420: 29.0.60; fns-tests-collate-strings fails on Cygwin
@ 2023-03-24 14:52 Ken Brown
  2023-03-25 12:24 ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Ken Brown @ 2023-03-24 14:52 UTC (permalink / raw)
  To: 62420

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





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#62420: 29.0.60; fns-tests-collate-strings fails on Cygwin
  2023-03-24 14:52 bug#62420: 29.0.60; fns-tests-collate-strings fails on Cygwin Ken Brown
@ 2023-03-25 12:24 ` Eli Zaretskii
  2023-03-25 14:27   ` Ken Brown
  0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2023-03-25 12:24 UTC (permalink / raw)
  To: Ken Brown; +Cc: 62420

> Date: Fri, 24 Mar 2023 10:52:45 -0400
> From: Ken Brown <kbrown@cornell.edu>
> 
> 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?

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?  Bonus points for making it an
expected failure for Cygwin < 3.5, assuming the version of Cygwin
could be obtained by the test code.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#62420: 29.0.60; fns-tests-collate-strings fails on Cygwin
  2023-03-25 12:24 ` Eli Zaretskii
@ 2023-03-25 14:27   ` Ken Brown
  2023-03-25 14:46     ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Ken Brown @ 2023-03-25 14:27 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 62420-done

On 3/25/2023 8:24 AM, Eli Zaretskii wrote:
>> Date: Fri, 24 Mar 2023 10:52:45 -0400
>> From: Ken Brown <kbrown@cornell.edu>
>> 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





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#62420: 29.0.60; fns-tests-collate-strings fails on Cygwin
  2023-03-25 14:27   ` Ken Brown
@ 2023-03-25 14:46     ` Eli Zaretskii
  2023-03-25 15:02       ` Corwin Brust
  2023-03-25 15:14       ` Ken Brown
  0 siblings, 2 replies; 8+ messages in thread
From: Eli Zaretskii @ 2023-03-25 14:46 UTC (permalink / raw)
  To: Ken Brown; +Cc: 62420

> Date: Sat, 25 Mar 2023 10:27:51 -0400
> Cc: 62420-done@debbugs.gnu.org
> From: Ken Brown <kbrown@cornell.edu>
> 
> On 3/25/2023 8:24 AM, Eli Zaretskii wrote:
> >> Date: Fri, 24 Mar 2023 10:52:45 -0400
> >> From: Ken Brown <kbrown@cornell.edu>
> >> 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.

Thanks.

> >  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.

What's the value of operating-system-release return in a Cygwin build?





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#62420: 29.0.60; fns-tests-collate-strings fails on Cygwin
  2023-03-25 14:46     ` Eli Zaretskii
@ 2023-03-25 15:02       ` Corwin Brust
  2023-03-25 15:14       ` Ken Brown
  1 sibling, 0 replies; 8+ messages in thread
From: Corwin Brust @ 2023-03-25 15:02 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 62420, Ken Brown

On Sat, Mar 25, 2023 at 9:46 AM Eli Zaretskii <eliz@gnu.org> wrote:
>
> What's the value of operating-system-release return in a Cygwin build?
>
corwi@Avalon /cygdrive/c/Users/corwi
$ emacs --version; emacs -batch -eval '(message "%s" operating-system-release)'
GNU Emacs 26.3
[...]
3.0.7-338.x86_64





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#62420: 29.0.60; fns-tests-collate-strings fails on Cygwin
  2023-03-25 14:46     ` Eli Zaretskii
  2023-03-25 15:02       ` Corwin Brust
@ 2023-03-25 15:14       ` Ken Brown
  2023-03-25 15:49         ` Eli Zaretskii
  1 sibling, 1 reply; 8+ messages in thread
From: Ken Brown @ 2023-03-25 15:14 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 62420

On 3/25/2023 10:46 AM, Eli Zaretskii wrote:
>> Date: Sat, 25 Mar 2023 10:27:51 -0400
>> Cc: 62420-done@debbugs.gnu.org
>> From: Ken Brown <kbrown@cornell.edu>
>> 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.
> 
> What's the value of operating-system-release return in a Cygwin build?

Perfect!  It's "3.4.6-1.x86_64".  I should be able to use that. 
Interestingly, that variable was made obsolete a couple years ago in 
commit d88e12aa19c4.

Ken





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#62420: 29.0.60; fns-tests-collate-strings fails on Cygwin
  2023-03-25 15:14       ` Ken Brown
@ 2023-03-25 15:49         ` Eli Zaretskii
  2023-03-25 16:47           ` Ken Brown
  0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2023-03-25 15:49 UTC (permalink / raw)
  To: Ken Brown; +Cc: 62420

> Date: Sat, 25 Mar 2023 11:14:57 -0400
> Cc: 62420@debbugs.gnu.org
> From: Ken Brown <kbrown@cornell.edu>
> 
> > What's the value of operating-system-release return in a Cygwin build?
> 
> Perfect!  It's "3.4.6-1.x86_64".  I should be able to use that. 
> Interestingly, that variable was made obsolete a couple years ago in 
> commit d88e12aa19c4.

We can un-obsolete it if Cygwin asks nicely ;-)

There's also the method used in report-emacs-bug--os-description,
maybe we could refactor it into a public function.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#62420: 29.0.60; fns-tests-collate-strings fails on Cygwin
  2023-03-25 15:49         ` Eli Zaretskii
@ 2023-03-25 16:47           ` Ken Brown
  0 siblings, 0 replies; 8+ messages in thread
From: Ken Brown @ 2023-03-25 16:47 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 62420

On 3/25/2023 11:49 AM, Eli Zaretskii wrote:
>> Date: Sat, 25 Mar 2023 11:14:57 -0400
>> Cc: 62420@debbugs.gnu.org
>> From: Ken Brown <kbrown@cornell.edu>
>>
>>> What's the value of operating-system-release return in a Cygwin build?
>>
>> Perfect!  It's "3.4.6-1.x86_64".  I should be able to use that.
>> Interestingly, that variable was made obsolete a couple years ago in
>> commit d88e12aa19c4.
> 
> We can un-obsolete it if Cygwin asks nicely ;-)

Thanks, but that's unnecessary.  It turns out that the test succeeds on 
the currently released Cygwin.  The bug that caused it to fail was 
introduced in the development sources for 3.5 and is now fixed there. 
So there's no known Cygwin release in which it fails.

But I'm glad to know about operating-system-release anyway.  Maybe it 
will be useful some other time.

Ken





^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-03-25 16:47 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-24 14:52 bug#62420: 29.0.60; fns-tests-collate-strings fails on Cygwin Ken Brown
2023-03-25 12:24 ` Eli Zaretskii
2023-03-25 14:27   ` Ken Brown
2023-03-25 14:46     ` Eli Zaretskii
2023-03-25 15:02       ` Corwin Brust
2023-03-25 15:14       ` Ken Brown
2023-03-25 15:49         ` Eli Zaretskii
2023-03-25 16:47           ` Ken Brown

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.