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 0E08E40DF1B for ; Sat, 20 Nov 2010 20:32:11 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -1.999 X-Spam-Level: X-Spam-Status: No, score=-1.999 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001] autolearn=ham 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 5so+C8JIyPuW for ; Sat, 20 Nov 2010 20:32:00 -0800 (PST) Received: from mail-ey0-f181.google.com (mail-ey0-f181.google.com [209.85.215.181]) by olra.theworths.org (Postfix) with ESMTP id 99DE640DF1C for ; Sat, 20 Nov 2010 20:31:59 -0800 (PST) Received: by eyb6 with SMTP id 6so3679954eyb.26 for ; Sat, 20 Nov 2010 20:31:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:user-agent :date:message-id:mime-version:content-type; bh=n+n+7JYivFqn0iOSPaU/gmskUKdGVieZd3ROJQLUl4I=; b=wMAbJ064NNKA8JaB7iLFGD1oFsRSQrQdfFiTVP3hBdIfYJ8tX3kZeYwOUqioEpL+kQ 4WRTEFbydF1nwqV3S8uqkM6GXR4LztK1fCBBr1P4d3ihjn8VWButK/Kw2jvPa6fzK4bg dv34yGZVS10JiRB2KOAZ0QnMPpcAdwU8XBr7g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:user-agent:date:message-id:mime-version :content-type; b=RtRu89bNQBWBWWRr9fDKe9z3bOnT2SscNJvLLQKq7pVWHY70UB6T4kI0d5yuV6XZGf RaVQPjf3ubzv2LjIRBZpwAUlZw30TR07OjosWf1xPVCXOdrgG7XhFMzWnUH4FTWmfAGK Jf9EMt84+VzrXupKJ1/HK8h9kfD+vluBHcBLA= Received: by 10.213.16.207 with SMTP id p15mr6477244eba.91.1290313915996; Sat, 20 Nov 2010 20:31:55 -0800 (PST) Received: from localhost ([91.144.186.21]) by mx.google.com with ESMTPS id w20sm3186699eeh.12.2010.11.20.20.31.53 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 20 Nov 2010 20:31:54 -0800 (PST) From: Dmitry Kurochkin To: notmuch@notmuchmail.org Subject: [PATCH] test: Add emacs test for messages with very long subjects User-Agent: Notmuch/0.5-2-g243ec33 (http://notmuchmail.org) Emacs/23.2.1 (x86_64-pc-linux-gnu) Date: Sun, 21 Nov 2010 07:31:45 +0300 Message-ID: <87tyjbnvpq.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" 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: Sun, 21 Nov 2010 04:32:11 -0000 --=-=-= test: Add emacs test for messages with very long subjects Emacs search does not show messages with very long subjects. The main notmuch view shows unread messages but nothing in the search results. Thus you can not remove unread tag from the emacs interface. The test uses 4018 character long subject. This is the minimal length to trigger the bug. I think the subject length should be increased to a much higher value once the bug is fixed. The test is currently failing. The code is borrowed from the "Message with .. in Message-Id:" test. Looks like this may be a common case for testing emacs interface bugs with particular messages and should be moved to a test-lib function. Regards, Dmitry --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=test-emacs-long-subject.patch commit f6892445d3212d49bcbfd2e50e6337c0a81eb26e Author: Dmitry Kurochkin Date: Sun Nov 21 07:10:15 2010 +0300 test: Add emacs test for messages with very long subjects Emacs search does not show messages with very long subjects. The main notmuch view shows unread messages but nothing in the search results. Thus you can not remove unread tag from the emacs interface. The test uses 4018 character long subject. This is the minimal length to trigger the bug. I think the subject length should be increased to a much higher value once the bug is fixed. The test is currently failing. The code is borrowed from the "Message with .. in Message-Id:" test. Looks like this may be a common case for testing emacs interface bugs with particular messages and should be moved to a test-lib function. diff --git a/test/emacs b/test/emacs index 75dec89..52b7d0d 100755 --- a/test/emacs +++ b/test/emacs @@ -51,40 +51,47 @@ test_begin_subtest "Remove tag from search view" test_emacs "(notmuch-search \"$os_x_darwin_thread\") (notmuch-test-wait) (notmuch-search-remove-tag \"tag-from-search-view\")" output=$(notmuch search $os_x_darwin_thread | notmuch_search_sanitize) test_expect_equal "$output" "thread:XXX 2009-11-18 [4/4] Jjgod Jiang, Alexander Botero-Lowry; [notmuch] Mac OS X/Darwin compatibility issues (inbox unread)" test_begin_subtest "Add tag from notmuch-show view" test_emacs "(notmuch-show \"$os_x_darwin_thread\") (notmuch-show-add-tag \"tag-from-show-view\")" output=$(notmuch search $os_x_darwin_thread | notmuch_search_sanitize) test_expect_equal "$output" "thread:XXX 2009-11-18 [4/4] Jjgod Jiang, Alexander Botero-Lowry; [notmuch] Mac OS X/Darwin compatibility issues (inbox tag-from-show-view unread)" test_begin_subtest "Remove tag from notmuch-show view" test_emacs "(notmuch-show \"$os_x_darwin_thread\") (notmuch-show-remove-tag \"tag-from-show-view\")" output=$(notmuch search $os_x_darwin_thread | notmuch_search_sanitize) test_expect_equal "$output" "thread:XXX 2009-11-18 [4/4] Jjgod Jiang, Alexander Botero-Lowry; [notmuch] Mac OS X/Darwin compatibility issues (inbox unread)" test_begin_subtest "Message with .. in Message-Id:" add_message [id]=123..456@example '[subject]="Message with .. in Message-Id"' test_emacs '(notmuch-search "id:\"123..456@example\"") (notmuch-test-wait) (notmuch-search-add-tag "search-add") (notmuch-search-add-tag "search-remove") (notmuch-search-remove-tag "search-remove") (notmuch-show "id:\"123..456@example\"") (notmuch-test-wait) (notmuch-show-add-tag "show-add") (notmuch-show-add-tag "show-remove") (notmuch-show-remove-tag "show-remove")' output=$(notmuch search 'id:"123..456@example"' | notmuch_search_sanitize) test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Message with .. in Message-Id (inbox search-add show-add)" +test_begin_subtest "Message with 4018 character long Subject:" +subject=`for i in \`seq 4018\`; do echo -n a; done` +add_message [id]=subject_4018@example [subject]=$subject +test_emacs '(notmuch-search "id:\"subject_4018@example\"") (notmuch-test-wait) (notmuch-search-add-tag "search-add") (notmuch-search-add-tag "search-remove") (notmuch-search-remove-tag "search-remove") (notmuch-show "id:\"subject_4018@example\"") (notmuch-test-wait) (notmuch-show-add-tag "show-add") (notmuch-show-add-tag "show-remove") (notmuch-show-remove-tag "show-remove")' +output=$(notmuch search 'id:"subject_4018@example"' | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; $subject (inbox search-add show-add)" + test_begin_subtest "Sending a message via (fake) SMTP" # Before we can send a message, we have to prepare the FCC maildir mkdir -p mail/sent/cur mkdir -p mail/sent/new mkdir -p mail/sent/tmp ../smtp-dummy sent_message & smtp_dummy_pid=$! test_emacs "(setq message-send-mail-function 'message-smtpmail-send-it) (setq smtpmail-smtp-server \"localhost\") (setq smtpmail-smtp-service \"25025\") (notmuch-hello) (notmuch-mua-mail) (message-goto-to) (insert \"user@example.com\nDate: Fri, 29 Mar 1974 10:00:00 -0000\") (message-goto-subject) (insert \"Testing message sent via SMTP\") (message-goto-body) (insert \"This is a test that messages are sent via SMTP\") (message-send-and-exit)" >/dev/null 2>&1 wait ${smtp_dummy_pid} output=$(sed \ -e s',^User-Agent: Notmuch/.* Emacs/.*,User-Agent: Notmuch/XXX Emacs/XXX,' \ -e s',^Message-ID: <.*>$,Message-ID: ,' < sent_message) test_expect_equal "$output" "From: Notmuch Test Suite To: user@example.com Subject: Testing message sent via SMTP Date: Fri, 29 Mar 1974 10:00:00 -0000 User-Agent: Notmuch/XXX Emacs/XXX --=-=-=--