From: Tomi Ollila <tomi.ollila@iki.fi>
To: Austin Clements <amdragon@MIT.EDU>, david@tethera.net
Cc: notmuch@notmuchmail.org, David Bremner <bremner@debian.org>
Subject: Re: [PATCH] test: use (format "%S") to print nil in emacs test.
Date: Fri, 31 Aug 2012 10:53:54 +0300 [thread overview]
Message-ID: <m23933lcod.fsf@guru.guru-group.fi> (raw)
In-Reply-To: <20120831035227.GH11179@mit.edu>
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
next prev parent reply other threads:[~2012-08-31 7:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2012-08-31 11:38 ` Tomi Ollila
2012-08-31 11:43 ` David Bremner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m23933lcod.fsf@guru.guru-group.fi \
--to=tomi.ollila@iki.fi \
--cc=amdragon@MIT.EDU \
--cc=bremner@debian.org \
--cc=david@tethera.net \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).