1 Return-Path: <dme@dme.org>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id 1431F431FDE
\r
6 for <notmuch@notmuchmail.org>; Tue, 24 Jan 2012 08:14:31 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5
\r
12 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id P0jThhjnY9bW for <notmuch@notmuchmail.org>;
\r
16 Tue, 24 Jan 2012 08:14:30 -0800 (PST)
\r
17 Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com
\r
18 [209.85.212.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
\r
19 (No client certificate requested)
\r
20 by olra.theworths.org (Postfix) with ESMTPS id 372DB431FD2
\r
21 for <notmuch@notmuchmail.org>; Tue, 24 Jan 2012 08:14:30 -0800 (PST)
\r
22 Received: by mail-wi0-f181.google.com with SMTP id hi8so1696072wib.26
\r
23 for <notmuch@notmuchmail.org>; Tue, 24 Jan 2012 08:14:29 -0800 (PST)
\r
25 Received: by 10.180.106.38 with SMTP id gr6mr4773279wib.0.1327421669918;
\r
26 Tue, 24 Jan 2012 08:14:29 -0800 (PST)
\r
27 Received: from hotblack-desiato.hh.sledj.net
\r
28 (host81-149-164-25.in-addr.btopenworld.com. [81.149.164.25])
\r
29 by mx.google.com with ESMTPS id t6sm19574812wid.1.2012.01.24.08.14.28
\r
30 (version=TLSv1/SSLv3 cipher=OTHER);
\r
31 Tue, 24 Jan 2012 08:14:28 -0800 (PST)
\r
32 Received: by hotblack-desiato.hh.sledj.net (Postfix, from userid 30000)
\r
33 id 0DE409FD48; Tue, 24 Jan 2012 16:14:27 +0000 (GMT)
\r
34 From: David Edmondson <dme@dme.org>
\r
35 To: notmuch@notmuchmail.org
\r
36 Subject: [PATCH 3/4 v43] test: Add more helpers for emacs tests.
\r
37 Date: Tue, 24 Jan 2012 16:14:06 +0000
\r
38 Message-Id: <1327421647-30405-4-git-send-email-dme@dme.org>
\r
39 X-Mailer: git-send-email 1.7.8.3
\r
40 In-Reply-To: <1327421647-30405-1-git-send-email-dme@dme.org>
\r
41 References: <1326804748-8989-2-git-send-email-dme@dme.org>
\r
42 <1327421647-30405-1-git-send-email-dme@dme.org>
\r
44 ALoCoQk3igtyv0ET+VFgvuad5NPAYXOoO38vhXvzo0CUupoyA23p6qvVPYS9l4t1pjwEvucBMf//
\r
45 X-BeenThere: notmuch@notmuchmail.org
\r
46 X-Mailman-Version: 2.1.13
\r
48 List-Id: "Use and development of the notmuch mail system."
\r
49 <notmuch.notmuchmail.org>
\r
50 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
51 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
52 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
53 List-Post: <mailto:notmuch@notmuchmail.org>
\r
54 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
55 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
56 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
57 X-List-Received-Date: Tue, 24 Jan 2012 16:14:31 -0000
\r
60 test/test-lib.el | 26 ++++++++++++++++++++++++++
\r
61 1 files changed, 26 insertions(+), 0 deletions(-)
\r
63 diff --git a/test/test-lib.el b/test/test-lib.el
\r
64 index 96752f0..bc75f06 100644
\r
65 --- a/test/test-lib.el
\r
66 +++ b/test/test-lib.el
\r
69 ;; Authors: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>
\r
71 +(require 'cl) ;; This code is generally used uncompiled.
\r
73 ;; `read-file-name' by default uses `completing-read' function to read
\r
74 ;; user input. It does not respect `standard-input' variable which we
\r
75 ;; use in tests to provide user input. So replace it with a plain
\r
76 @@ -92,3 +94,27 @@ nothing."
\r
78 (prin1-to-string result)))
\r
81 +(defun notmuch-test-report-unexpected (output expected)
\r
82 + "Report that the OUTPUT does not match the EXPECTED result."
\r
83 + (concat "Expect:\t" (prin1-to-string expected) "\n"
\r
84 + "Output:\t" (prin1-to-string output) "\n"))
\r
86 +(defun notmuch-test-expect-equal (output expected)
\r
87 + "Compare OUTPUT with EXPECTED. Report any discrepencies."
\r
88 + (if (equal output expected)
\r
91 + ((and (listp output)
\r
93 + ;; Reporting the difference between two lists is done by
\r
94 + ;; reporting differing elements of OUTPUT and EXPECTED
\r
95 + ;; pairwise. This is expected to make analysis of failures
\r
97 + (apply #'concat (loop for o in output
\r
99 + if (not (equal o e))
\r
100 + collect (notmuch-test-report-unexpected o e))))
\r
103 + (notmuch-test-report-unexpected output expected)))))
\r