unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#24944: [PATCH] Skip test-seq-random-elt-take-all on Emacs 24
@ 2016-11-15  4:00 Sean Whitton
  2016-11-15 15:20 ` Eli Zaretskii
  0 siblings, 1 reply; 10+ messages in thread
From: Sean Whitton @ 2016-11-15  4:00 UTC (permalink / raw)
  To: 24944; +Cc: Sean Whitton

The function `map-length' is not available.
---
 packages/seq/tests/seq-tests.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/packages/seq/tests/seq-tests.el b/packages/seq/tests/seq-tests.el
index 53930fa..7a9a452 100644
--- a/packages/seq/tests/seq-tests.el
+++ b/packages/seq/tests/seq-tests.el
@@ -351,6 +351,7 @@ Evaluate BODY for each created sequence.
                    ["xxx" "xx" "x"]))))
 
 (ert-deftest test-seq-random-elt-take-all ()
+  (skip-unless (version> emacs-version "25"))
   (let ((seq '(a b c d e))
         (count '()))
     (should (= 0 (map-length count)))
-- 
2.10.2






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

* bug#24944: [PATCH] Skip test-seq-random-elt-take-all on Emacs 24
  2016-11-15  4:00 bug#24944: [PATCH] Skip test-seq-random-elt-take-all on Emacs 24 Sean Whitton
@ 2016-11-15 15:20 ` Eli Zaretskii
  2016-11-15 16:06   ` Sean Whitton
  0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2016-11-15 15:20 UTC (permalink / raw)
  To: Sean Whitton; +Cc: 24944

> From: Sean Whitton <spwhitton@spwhitton.name>
> Date: Mon, 14 Nov 2016 21:00:50 -0700
> Cc: Sean Whitton <spwhitton@spwhitton.name>
> 
> The function `map-length' is not available.
> ---
>  packages/seq/tests/seq-tests.el | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/packages/seq/tests/seq-tests.el b/packages/seq/tests/seq-tests.el
> index 53930fa..7a9a452 100644
> --- a/packages/seq/tests/seq-tests.el
> +++ b/packages/seq/tests/seq-tests.el
> @@ -351,6 +351,7 @@ Evaluate BODY for each created sequence.
>                     ["xxx" "xx" "x"]))))
>  
>  (ert-deftest test-seq-random-elt-take-all ()
> +  (skip-unless (version> emacs-version "25"))
>    (let ((seq '(a b c d e))
>          (count '()))
>      (should (= 0 (map-length count)))

A better test is to use fboundp (after requiring the package that
should define it) to probe whether the function exists or not, instead
of relying on the version.

Thanks.





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

* bug#24944: [PATCH] Skip test-seq-random-elt-take-all on Emacs 24
  2016-11-15 15:20 ` Eli Zaretskii
@ 2016-11-15 16:06   ` Sean Whitton
  2016-11-15 17:02     ` Nicolas Petton
  0 siblings, 1 reply; 10+ messages in thread
From: Sean Whitton @ 2016-11-15 16:06 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 24944


[-- Attachment #1.1: Type: text/plain, Size: 370 bytes --]

On Tue, Nov 15, 2016 at 05:20:36PM +0200, Eli Zaretskii wrote:
> A better test is to use fboundp (after requiring the package that
> should define it) to probe whether the function exists or not, instead
> of relying on the version.

Thanks.  Improved patch attached.

Note that this is against the version of seq in elpa.git, not emacs.git

-- 
Sean Whitton

[-- Attachment #1.2: 0001-Skip-test-seq-random-elt-take-all-on-Emacs-24.patch --]
[-- Type: text/x-diff, Size: 1040 bytes --]

From 494e3476538cd2cefdc7343057ccfb33412aca73 Mon Sep 17 00:00:00 2001
From: Sean Whitton <spwhitton@spwhitton.name>
Date: Mon, 14 Nov 2016 20:58:14 -0700
Subject: [PATCH] Skip test-seq-random-elt-take-all on Emacs 24

The function `map-length' is not available.
---
 packages/seq/tests/seq-tests.el | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/packages/seq/tests/seq-tests.el b/packages/seq/tests/seq-tests.el
index 53930fa..0e15f25 100644
--- a/packages/seq/tests/seq-tests.el
+++ b/packages/seq/tests/seq-tests.el
@@ -28,6 +28,7 @@
 
 (require 'ert)
 (require 'seq)
+(require 'map)
 
 (defmacro with-test-sequences (spec &rest body)
   "Successively bind VAR to a list, vector, and string built from SEQ.
@@ -351,6 +352,7 @@ Evaluate BODY for each created sequence.
                    ["xxx" "xx" "x"]))))
 
 (ert-deftest test-seq-random-elt-take-all ()
+  (skip-unless (fboundp 'map-length))
   (let ((seq '(a b c d e))
         (count '()))
     (should (= 0 (map-length count)))
-- 
2.10.2


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

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

* bug#24944: [PATCH] Skip test-seq-random-elt-take-all on Emacs 24
  2016-11-15 16:06   ` Sean Whitton
@ 2016-11-15 17:02     ` Nicolas Petton
  2016-11-15 17:06       ` Sean Whitton
  0 siblings, 1 reply; 10+ messages in thread
From: Nicolas Petton @ 2016-11-15 17:02 UTC (permalink / raw)
  To: Sean Whitton, Eli Zaretskii; +Cc: 24944

[-- Attachment #1: Type: text/plain, Size: 195 bytes --]

Sean Whitton <spwhitton@spwhitton.name> writes:

> Thanks.  Improved patch attached.

Looks good, but what about not using map.el here (it's an alist) instead
of skipping the test?

Cheers,
Nico

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 472 bytes --]

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

* bug#24944: [PATCH] Skip test-seq-random-elt-take-all on Emacs 24
  2016-11-15 17:02     ` Nicolas Petton
@ 2016-11-15 17:06       ` Sean Whitton
  2016-11-15 20:13         ` Nicolas Petton
  0 siblings, 1 reply; 10+ messages in thread
From: Sean Whitton @ 2016-11-15 17:06 UTC (permalink / raw)
  To: Nicolas Petton; +Cc: 24944

[-- Attachment #1: Type: text/plain, Size: 331 bytes --]

On Tue, Nov 15, 2016 at 06:02:56PM +0100, Nicolas Petton wrote:
> Sean Whitton <spwhitton@spwhitton.name> writes:
> 
> > Thanks.  Improved patch attached.
> 
> Looks good, but what about not using map.el here (it's an alist) instead
> of skipping the test?

Are you suggesting: s/map-length/length/ ?

-- 
Sean Whitton

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

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

* bug#24944: [PATCH] Skip test-seq-random-elt-take-all on Emacs 24
  2016-11-15 17:06       ` Sean Whitton
@ 2016-11-15 20:13         ` Nicolas Petton
  2016-11-15 22:44           ` Sean Whitton
  0 siblings, 1 reply; 10+ messages in thread
From: Nicolas Petton @ 2016-11-15 20:13 UTC (permalink / raw)
  To: Sean Whitton; +Cc: 24944

[-- Attachment #1: Type: text/plain, Size: 390 bytes --]

Sean Whitton <spwhitton@spwhitton.name> writes:

> Are you suggesting: s/map-length/length/ ?

There's also a usage of `map-put' to replace, as well as the `require'
in the beginning of the file.

However, seq.el was introduced in Emacs 25.1, so in the Emacs repository
there is no need to change anything there.  I suppose you're talking
about the version of seq.el in ELPA?

Cheers,
Nico

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 472 bytes --]

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

* bug#24944: [PATCH] Skip test-seq-random-elt-take-all on Emacs 24
  2016-11-15 20:13         ` Nicolas Petton
@ 2016-11-15 22:44           ` Sean Whitton
  2016-11-15 22:58             ` Nicolas Petton
  0 siblings, 1 reply; 10+ messages in thread
From: Sean Whitton @ 2016-11-15 22:44 UTC (permalink / raw)
  To: Nicolas Petton; +Cc: 24944

[-- Attachment #1: Type: text/plain, Size: 834 bytes --]

Hello,

On Tue, Nov 15, 2016 at 09:13:26PM +0100, Nicolas Petton wrote:
> Sean Whitton <spwhitton@spwhitton.name> writes:
> 
> > Are you suggesting: s/map-length/length/ ?
> 
> There's also a usage of `map-put' to replace, as well as the `require'
> in the beginning of the file.

Can the usage of `map-put' be replaced?

If not, it might be best just to wrap both the `require' and the whole
test in my original version check.

> However, seq.el was introduced in Emacs 25.1, so in the Emacs
> repository there is no need to change anything there.  I suppose
> you're talking about the version of seq.el in ELPA?

Yes.

For background, I was prompted to write this patch while updating the
packaging of seq.el in Debian, which for the moment contains both
emacs24 and emacs25.

Thanks!

-- 
Sean Whitton

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

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

* bug#24944: [PATCH] Skip test-seq-random-elt-take-all on Emacs 24
  2016-11-15 22:44           ` Sean Whitton
@ 2016-11-15 22:58             ` Nicolas Petton
  2016-11-16  0:30               ` Sean Whitton
  0 siblings, 1 reply; 10+ messages in thread
From: Nicolas Petton @ 2016-11-15 22:58 UTC (permalink / raw)
  To: Sean Whitton; +Cc: 24944

[-- Attachment #1: Type: text/plain, Size: 323 bytes --]

Sean Whitton <spwhitton@spwhitton.name> writes:

> Can the usage of `map-put' be replaced?

Yes, I can install a patch if you want.

> For background, I was prompted to write this patch while updating the
> packaging of seq.el in Debian, which for the moment contains both
> emacs24 and emacs25.

Ok, I get it now :)

Nico

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 472 bytes --]

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

* bug#24944: [PATCH] Skip test-seq-random-elt-take-all on Emacs 24
  2016-11-15 22:58             ` Nicolas Petton
@ 2016-11-16  0:30               ` Sean Whitton
  2016-11-16 17:40                 ` Nicolas Petton
  0 siblings, 1 reply; 10+ messages in thread
From: Sean Whitton @ 2016-11-16  0:30 UTC (permalink / raw)
  To: Nicolas Petton; +Cc: 24944

[-- Attachment #1: Type: text/plain, Size: 321 bytes --]

On Tue, Nov 15, 2016 at 11:58:19PM +0100, Nicolas Petton wrote:
> Sean Whitton <spwhitton@spwhitton.name> writes:
> 
> > Can the usage of `map-put' be replaced?
> 
> Yes, I can install a patch if you want.

That would be great, but obviously not a priority.  Thanks again for
your feedback.

-- 
Sean Whitton

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

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

* bug#24944: [PATCH] Skip test-seq-random-elt-take-all on Emacs 24
  2016-11-16  0:30               ` Sean Whitton
@ 2016-11-16 17:40                 ` Nicolas Petton
  0 siblings, 0 replies; 10+ messages in thread
From: Nicolas Petton @ 2016-11-16 17:40 UTC (permalink / raw)
  To: Sean Whitton; +Cc: 24944, 24944-done

[-- Attachment #1: Type: text/plain, Size: 232 bytes --]

Sean Whitton <spwhitton@spwhitton.name> writes:

> That would be great, but obviously not a priority.  Thanks again for
> your feedback.

I installed a patch in Emacs and ELPA (commit 2d6022a).  I'm closing the
issue.

Cheers,
Nico

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 472 bytes --]

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

end of thread, other threads:[~2016-11-16 17:40 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-15  4:00 bug#24944: [PATCH] Skip test-seq-random-elt-take-all on Emacs 24 Sean Whitton
2016-11-15 15:20 ` Eli Zaretskii
2016-11-15 16:06   ` Sean Whitton
2016-11-15 17:02     ` Nicolas Petton
2016-11-15 17:06       ` Sean Whitton
2016-11-15 20:13         ` Nicolas Petton
2016-11-15 22:44           ` Sean Whitton
2016-11-15 22:58             ` Nicolas Petton
2016-11-16  0:30               ` Sean Whitton
2016-11-16 17:40                 ` Nicolas Petton

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).