unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] test: use (format "%S") to print nil in emacs test.
@ 2012-08-31  1:09 david
  2012-08-31  3:52 ` Austin Clements
  2012-08-31 11:43 ` David Bremner
  0 siblings, 2 replies; 5+ messages in thread
From: david @ 2012-08-31  1:09 UTC (permalink / raw)
  To: notmuch; +Cc: David Bremner

From: David Bremner <bremner@debian.org>

The behaviour of "emacsclient --eval nil" changed from emacs23 to
emacs24, and in emacs24 it prints 'nil' rather than an empty string.

(format "%S" foo) produces a sexpr form of foo, and is consistent
between the two versions.
---

This fixes another test failure on emacs24. 

I guess maybe all test_emacs output could be canonicalized this way,
but I suspect that would be pretty disruptive.

 test/emacs-subject-to-filename |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/test/emacs-subject-to-filename b/test/emacs-subject-to-filename
index 176e685..a0ffdfe 100755
--- a/test/emacs-subject-to-filename
+++ b/test/emacs-subject-to-filename
@@ -8,10 +8,10 @@ test_emacs '(ignore)'
 
 # test notmuch-wash-subject-to-patch-sequence-number (subject)
 test_begin_subtest "no patch sequence number"
-output=$(test_emacs '(notmuch-wash-subject-to-patch-sequence-number
-      "[PATCH] A normal patch subject without numbers")'
+output=$(test_emacs '(format "%S" (notmuch-wash-subject-to-patch-sequence-number
+      "[PATCH] A normal patch subject without numbers"))'
 )
-test_expect_equal "$output" ""
+test_expect_equal "$output" '"nil"'
 
 test_begin_subtest "patch sequence number #1"
 output=$(test_emacs '(notmuch-wash-subject-to-patch-sequence-number
-- 
1.7.10.4

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

* Re: [PATCH] test: use (format "%S") to print nil in emacs test.
  2012-08-31  1:09 [PATCH] test: use (format "%S") to print nil in emacs test david
@ 2012-08-31  3:52 ` Austin Clements
  2012-08-31  7:53   ` Tomi Ollila
  2012-08-31 11:43 ` David Bremner
  1 sibling, 1 reply; 5+ messages in thread
From: Austin Clements @ 2012-08-31  3:52 UTC (permalink / raw)
  To: david; +Cc: notmuch, David Bremner

LGTM.  Alternatively, the test could be
  (null (notmuch-wash....))
with the correct answer being 't'.  That would avoid the awkward
detour through a string, but either way is good as long as this test
passes.

Quoth david@tethera.net on Aug 30 at 10:09 pm:
> From: David Bremner <bremner@debian.org>
> 
> The behaviour of "emacsclient --eval nil" changed from emacs23 to
> emacs24, and in emacs24 it prints 'nil' rather than an empty string.
> 
> (format "%S" foo) produces a sexpr form of foo, and is consistent
> between the two versions.
> ---
> 
> This fixes another test failure on emacs24. 
> 
> I guess maybe all test_emacs output could be canonicalized this way,
> but I suspect that would be pretty disruptive.
> 
>  test/emacs-subject-to-filename |    6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/test/emacs-subject-to-filename b/test/emacs-subject-to-filename
> index 176e685..a0ffdfe 100755
> --- a/test/emacs-subject-to-filename
> +++ b/test/emacs-subject-to-filename
> @@ -8,10 +8,10 @@ test_emacs '(ignore)'
>  
>  # test notmuch-wash-subject-to-patch-sequence-number (subject)
>  test_begin_subtest "no patch sequence number"
> -output=$(test_emacs '(notmuch-wash-subject-to-patch-sequence-number
> -      "[PATCH] A normal patch subject without numbers")'
> +output=$(test_emacs '(format "%S" (notmuch-wash-subject-to-patch-sequence-number
> +      "[PATCH] A normal patch subject without numbers"))'
>  )
> -test_expect_equal "$output" ""
> +test_expect_equal "$output" '"nil"'
>  
>  test_begin_subtest "patch sequence number #1"
>  output=$(test_emacs '(notmuch-wash-subject-to-patch-sequence-number

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

* Re: [PATCH] test: use (format "%S") to print nil in emacs test.
  2012-08-31  3:52 ` Austin Clements
@ 2012-08-31  7:53   ` Tomi Ollila
  2012-08-31 11:38     ` Tomi Ollila
  0 siblings, 1 reply; 5+ messages in thread
From: Tomi Ollila @ 2012-08-31  7:53 UTC (permalink / raw)
  To: Austin Clements, david; +Cc: notmuch, David Bremner

On Fri, Aug 31 2012, Austin Clements <amdragon@MIT.EDU> wrote:

> LGTM.  Alternatively, the test could be
>   (null (notmuch-wash....))
> with the correct answer being 't'.  That would avoid the awkward
> detour through a string, but either way is good as long as this test
> passes.

I was going to vote this (null ... thing) but as the function returns
nil when no match found it is more obvious th compare for that instead
of "t".

And, there is not much of a detour for the expected value nil, outputted
as "nil" (without quotes) :).

So: 

LGTM. "Alternatively, the test could" use (prin1 (...)) directly,
"but either way is good as long as this test passes."

Tomi

>
> Quoth david@tethera.net on Aug 30 at 10:09 pm:
>> From: David Bremner <bremner@debian.org>
>> 
>> The behaviour of "emacsclient --eval nil" changed from emacs23 to
>> emacs24, and in emacs24 it prints 'nil' rather than an empty string.
>> 
>> (format "%S" foo) produces a sexpr form of foo, and is consistent
>> between the two versions.
>> ---
>> 
>> This fixes another test failure on emacs24. 
>> 
>> I guess maybe all test_emacs output could be canonicalized this way,
>> but I suspect that would be pretty disruptive.
>> 
>>  test/emacs-subject-to-filename |    6 +++---
>>  1 file changed, 3 insertions(+), 3 deletions(-)
>> 
>> diff --git a/test/emacs-subject-to-filename b/test/emacs-subject-to-filename
>> index 176e685..a0ffdfe 100755
>> --- a/test/emacs-subject-to-filename
>> +++ b/test/emacs-subject-to-filename
>> @@ -8,10 +8,10 @@ test_emacs '(ignore)'
>>  
>>  # test notmuch-wash-subject-to-patch-sequence-number (subject)
>>  test_begin_subtest "no patch sequence number"
>> -output=$(test_emacs '(notmuch-wash-subject-to-patch-sequence-number
>> -      "[PATCH] A normal patch subject without numbers")'
>> +output=$(test_emacs '(format "%S" (notmuch-wash-subject-to-patch-sequence-number
>> +      "[PATCH] A normal patch subject without numbers"))'
>>  )
>> -test_expect_equal "$output" ""
>> +test_expect_equal "$output" '"nil"'
>>  
>>  test_begin_subtest "patch sequence number #1"
>>  output=$(test_emacs '(notmuch-wash-subject-to-patch-sequence-number
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch

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

* Re: [PATCH] test: use (format "%S") to print nil in emacs test.
  2012-08-31  7:53   ` Tomi Ollila
@ 2012-08-31 11:38     ` Tomi Ollila
  0 siblings, 0 replies; 5+ messages in thread
From: Tomi Ollila @ 2012-08-31 11:38 UTC (permalink / raw)
  To: Austin Clements, david; +Cc: notmuch, David Bremner

On Fri, Aug 31 2012, Tomi Ollila <tomi.ollila@iki.fi> wrote:

> On Fri, Aug 31 2012, Austin Clements <amdragon@MIT.EDU> wrote:
>
>> LGTM.  Alternatively, the test could be
>>   (null (notmuch-wash....))
>> with the correct answer being 't'.  That would avoid the awkward
>> detour through a string, but either way is good as long as this test
>> passes.
>
> I was going to vote this (null ... thing) but as the function returns
> nil when no match found it is more obvious th compare for that instead
> of "t".
>
> And, there is not much of a detour for the expected value nil, outputted
> as "nil" (without quotes) :).
>
> So: 
>
> LGTM. "Alternatively, the test could" use (prin1 (...)) directly,
> "but either way is good as long as this test passes."

I withdraw this prin1 suggestion, as it doesn't seem to work with
all emaces (if any, I thought I test this well enough). 
Probably the reason is that format returns string and prin1 prints
it -- but when using emacsclient the prints (might) go to the buffer 
never seen...)

So, unconditional LGTM :D

> Tomi

Tomi


>
>>
>> Quoth david@tethera.net on Aug 30 at 10:09 pm:
>>> From: David Bremner <bremner@debian.org>
>>> 
>>> The behaviour of "emacsclient --eval nil" changed from emacs23 to
>>> emacs24, and in emacs24 it prints 'nil' rather than an empty string.
>>> 
>>> (format "%S" foo) produces a sexpr form of foo, and is consistent
>>> between the two versions.
>>> ---
>>> 
>>> This fixes another test failure on emacs24. 
>>> 
>>> I guess maybe all test_emacs output could be canonicalized this way,
>>> but I suspect that would be pretty disruptive.
>>> 
>>>  test/emacs-subject-to-filename |    6 +++---
>>>  1 file changed, 3 insertions(+), 3 deletions(-)
>>> 
>>> diff --git a/test/emacs-subject-to-filename b/test/emacs-subject-to-filename
>>> index 176e685..a0ffdfe 100755
>>> --- a/test/emacs-subject-to-filename
>>> +++ b/test/emacs-subject-to-filename
>>> @@ -8,10 +8,10 @@ test_emacs '(ignore)'
>>>  
>>>  # test notmuch-wash-subject-to-patch-sequence-number (subject)
>>>  test_begin_subtest "no patch sequence number"
>>> -output=$(test_emacs '(notmuch-wash-subject-to-patch-sequence-number
>>> -      "[PATCH] A normal patch subject without numbers")'
>>> +output=$(test_emacs '(format "%S" (notmuch-wash-subject-to-patch-sequence-number
>>> +      "[PATCH] A normal patch subject without numbers"))'
>>>  )
>>> -test_expect_equal "$output" ""
>>> +test_expect_equal "$output" '"nil"'
>>>  
>>>  test_begin_subtest "patch sequence number #1"
>>>  output=$(test_emacs '(notmuch-wash-subject-to-patch-sequence-number
>> _______________________________________________
>> notmuch mailing list
>> notmuch@notmuchmail.org
>> http://notmuchmail.org/mailman/listinfo/notmuch

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

* Re: [PATCH] test: use (format "%S") to print nil in emacs test.
  2012-08-31  1:09 [PATCH] test: use (format "%S") to print nil in emacs test david
  2012-08-31  3:52 ` Austin Clements
@ 2012-08-31 11:43 ` David Bremner
  1 sibling, 0 replies; 5+ messages in thread
From: David Bremner @ 2012-08-31 11:43 UTC (permalink / raw)
  To: notmuch

david@tethera.net writes:

> From: David Bremner <bremner@debian.org>
>
> The behaviour of "emacsclient --eval nil" changed from emacs23 to
> emacs24, and in emacs24 it prints 'nil' rather than an empty string.

pushed, 

d

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

end of thread, other threads:[~2012-08-31 11:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-31  1:09 [PATCH] test: use (format "%S") to print nil in emacs test david
2012-08-31  3:52 ` Austin Clements
2012-08-31  7:53   ` Tomi Ollila
2012-08-31 11:38     ` Tomi Ollila
2012-08-31 11:43 ` David Bremner

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

	https://yhetil.org/notmuch.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).