From: Tomi Ollila Date: Fri, 31 Aug 2012 07:53:54 +0000 (+0300) Subject: Re: [PATCH] test: use (format "%S") to print nil in emacs test. X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=0daf9cba30ec684408b015ffa6e5d15d79ac3b94;p=notmuch-archives.git Re: [PATCH] test: use (format "%S") to print nil in emacs test. --- diff --git a/8b/d01f5e114dd25bbcb1edf898e41035a474fe08 b/8b/d01f5e114dd25bbcb1edf898e41035a474fe08 new file mode 100644 index 000000000..df28bba7e --- /dev/null +++ b/8b/d01f5e114dd25bbcb1edf898e41035a474fe08 @@ -0,0 +1,115 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id D456B431FAF + for ; Fri, 31 Aug 2012 00:53:46 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] + autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id UhyVsXSnHZ5w for ; + Fri, 31 Aug 2012 00:53:46 -0700 (PDT) +Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) + by olra.theworths.org (Postfix) with ESMTP id 3151A431FAE + for ; Fri, 31 Aug 2012 00:53:46 -0700 (PDT) +Received: from guru.guru-group.fi (localhost [IPv6:::1]) + by guru.guru-group.fi (Postfix) with ESMTP id 3F34A100030; + Fri, 31 Aug 2012 10:53:54 +0300 (EEST) +From: Tomi Ollila +To: Austin Clements , david@tethera.net +Subject: Re: [PATCH] test: use (format "%S") to print nil in emacs test. +In-Reply-To: <20120831035227.GH11179@mit.edu> +References: <1346375399-449-1-git-send-email-david@tethera.net> + <20120831035227.GH11179@mit.edu> +User-Agent: Notmuch/0.14+11~gd9bf007 (http://notmuchmail.org) Emacs/24.1.1 + (x86_64-unknown-linux-gnu) +X-Face: HhBM'cA~ +MIME-Version: 1.0 +Content-Type: text/plain +Cc: notmuch@notmuchmail.org, David Bremner +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Fri, 31 Aug 2012 07:53:47 -0000 + +On Fri, Aug 31 2012, Austin Clements 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 +>> +>> 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