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 BF822431FAF for ; Tue, 5 Jun 2012 08:42:58 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7] 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 bHsOT2NLOnpw for ; Tue, 5 Jun 2012 08:42:57 -0700 (PDT) Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com [209.85.217.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id AEC9F431FAE for ; Tue, 5 Jun 2012 08:42:56 -0700 (PDT) Received: by lbbgk8 with SMTP id gk8so4532415lbb.26 for ; Tue, 05 Jun 2012 08:42:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:subject:date:message-id:x-mailer:x-gm-message-state; bh=60q7E+CwrVM2+pSOslUpoCU/psjblf3iHWr1Fq0eQkI=; b=lOlNNUAlaIv9/kK3sdUpFkpsfmh+FSZS7lBCaI719FqsmSKSIjllJnWI/VxCRn3Fza 2M5KlKgrabtFpOK6gTQsEuGLrfge74Poy+oBwW/s92zhqHwG91YPKEOyTe5e8rTY7eYs uMZgKB/zgf9GJM0kfnhi0tc1RNMysxi7OC2AhrZY2MmvdZMcKQ+p+jlTb7v5bZxlLE+5 4Otor2kJekRmKpKyWz2omZsR40GcZBtq+jfv/PRi3TtfkaunpqQMoBVmhsXfzCZh+JbN c9YYuYsElJwlxQjMClT93fL79Aom7gnUjfkWjzEh5GD1QrrRgdeuGb0GituvuhBo1dYB Q1HQ== Received: by 10.152.106.12 with SMTP id gq12mr8855160lab.17.1338910974892; Tue, 05 Jun 2012 08:42:54 -0700 (PDT) Received: from localhost (dsl-hkibrasgw4-fe50dc00-68.dhcp.inet.fi. [80.220.80.68]) by mx.google.com with ESMTPS id gt19sm3128217lab.17.2012.06.05.08.42.53 (version=SSLv3 cipher=OTHER); Tue, 05 Jun 2012 08:42:54 -0700 (PDT) From: Jani Nikula To: notmuch@notmuchmail.org Subject: [PATCH 1/2] test: add test for emacs notmuch-show-strip-re function Date: Tue, 5 Jun 2012 18:42:50 +0300 Message-Id: <3a9ce3cd2074e311f86f3e416644b2879516ffbf.1338910938.git.jani@nikula.org> X-Mailer: git-send-email 1.7.9.5 X-Gm-Message-State: ALoCoQmYU1HcriHIozAPV0yUoXOeANx3vCzFSyCjv96ZqmQcpDJXguxThDo6yvYnXReJbTmGdXwV 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: Tue, 05 Jun 2012 15:42:58 -0000 The function is used for stripping "re:" from subjects to generate "bare subjects". Include broken test for having "re:" in the middle of the subject. --- test/emacs-show | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/emacs-show b/test/emacs-show index 2498564..1ddb28e 100755 --- a/test/emacs-show +++ b/test/emacs-show @@ -24,4 +24,17 @@ test_emacs "(notmuch-show \"id:$message_id\") (test-visible-output)" test_expect_equal_file OUTPUT EXPECTED +test_begin_subtest "Bare subject #1" +output=$(test_emacs '(notmuch-show-strip-re "Re: subject")') +test_expect_equal "$output" '"subject"' + +test_begin_subtest "Bare subject #2" +output=$(test_emacs '(notmuch-show-strip-re "re:Re: re: Re: re:subject")') +test_expect_equal "$output" '"subject"' + +test_begin_subtest "Bare subject #3" +test_subtest_known_broken +output=$(test_emacs '(notmuch-show-strip-re "the cure: fix the regexp")') +test_expect_equal "$output" '"the cure: fix the regexp"' + test_done -- 1.7.9.5