From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 1974E431FAF for ; Sat, 23 Jun 2012 20:28:14 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.799 X-Spam-Level: X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, 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 Th37z4NMI0ZI for ; Sat, 23 Jun 2012 20:28:13 -0700 (PDT) Received: from mail-pz0-f53.google.com (mail-pz0-f53.google.com [209.85.210.53]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 55D65431FAE for ; Sat, 23 Jun 2012 20:28:13 -0700 (PDT) Received: by dadg9 with SMTP id g9so4920782dad.26 for ; Sat, 23 Jun 2012 20:28:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:mime-version :content-type:content-transfer-encoding; bh=cuNoHQ6VzxVPHD7ncqZRlVttLZhRWO1aoMtFpa9p4vk=; b=hUb+SJtjBgnjbLOqgxp7xpsVK08KFFMos1qLjUgrp3UZ8dzQL2ml6YSi9/NwxtYWIO 4QMabdQWC6DjSG9ZvyfK0F6sCx+TTcuFQA7mc/U7dfc2AWdH6HrTptQGtzHTuFG3vMn9 7X/X70XoRZmC3f96NDuCvX6VATizyk6bkahT7fpU/gN3D3rb9vW8auOYt92pIBtM/E9T JpRkawVPzSstraeYz1WMh3dNiWd8YGJBZUkZrNd5kWATXIw8ygsU5b8qiM11bbopqlaZ /+52H+xiNQT2xIbKyhEyegLsDZfPGbkFth4HEs/i65uPg27hirO2obztRVRVLA5uQY2N K8LQ== Received: by 10.68.193.226 with SMTP id hr2mr25340510pbc.155.1340508492423; Sat, 23 Jun 2012 20:28:12 -0700 (PDT) Received: from localhost (215.42.233.220.static.exetel.com.au. [220.233.42.215]) by mx.google.com with ESMTPS id tm2sm4073738pbc.69.2012.06.23.20.28.09 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 23 Jun 2012 20:28:11 -0700 (PDT) From: Peter Wang To: notmuch@notmuchmail.org Subject: [PATCH 1/3] test: add basic show, search --format=text tests Date: Sun, 24 Jun 2012 13:27:48 +1000 Message-Id: <1340508470-16606-1-git-send-email-novalazy@gmail.com> X-Mailer: git-send-email 1.7.4.4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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, 24 Jun 2012 03:28:14 -0000 There didn't seem to be these basic tests for --format=text, as there are for --format=json. These are just the tests from the `json' script, with adjusted expected outputs. --- test/notmuch-test | 1 + test/text | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 0 deletions(-) create mode 100755 test/text diff --git a/test/notmuch-test b/test/notmuch-test index bfad5d3..ea39dfc 100755 --- a/test/notmuch-test +++ b/test/notmuch-test @@ -31,6 +31,7 @@ TESTS=" excludes tagging json + text multipart thread-naming raw diff --git a/test/text b/test/text new file mode 100755 index 0000000..428c89b --- /dev/null +++ b/test/text @@ -0,0 +1,55 @@ +#!/usr/bin/env bash +test_description="--format=text output" +. ./test-lib.sh + +test_begin_subtest "Show message: text" +add_message "[subject]=\"text-show-subject\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=\"text-show-message\"" +output=$(notmuch show --format=text "text-show-message" | notmuch_show_sanitize_all) +test_expect_equal "$output" "\ + message{ id:XXXXX depth:0 match:1 excluded:0 filename:XXXXX + header{ +Notmuch Test Suite (2000-01-01) (inbox unread) +Subject: text-show-subject +From: Notmuch Test Suite +To: Notmuch Test Suite +Date: Sat, 01 Jan 2000 12:00:00 +0000 + header} + body{ + part{ ID: 1, Content-type: text/plain +text-show-message + part} + body} + message}" + +test_begin_subtest "Search message: text" +add_message "[subject]=\"text-search-subject\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=\"text-search-message\"" +output=$(notmuch search --format=text "text-search-message" | notmuch_search_sanitize) +test_expect_equal "$output" \ +"thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; text-search-subject (inbox unread)" + +test_begin_subtest "Show message: text, utf-8" +add_message "[subject]=\"text-show-utf8-body-sübjéct\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=\"tëxt-show-méssage\"" +output=$(notmuch show --format=text "tëxt-show-méssage" | notmuch_show_sanitize_all) +test_expect_equal "$output" "\ + message{ id:XXXXX depth:0 match:1 excluded:0 filename:XXXXX + header{ +Notmuch Test Suite (2000-01-01) (inbox unread) +Subject: text-show-utf8-body-sübjéct +From: Notmuch Test Suite +To: Notmuch Test Suite +Date: Sat, 01 Jan 2000 12:00:00 +0000 + header} + body{ + part{ ID: 1, Content-type: text/plain +tëxt-show-méssage + part} + body} + message}" + +test_begin_subtest "Search message: text, utf-8" +add_message "[subject]=\"text-search-utf8-body-sübjéct\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=\"tëxt-search-méssage\"" +output=$(notmuch search --format=text "tëxt-search-méssage" | notmuch_search_sanitize) +test_expect_equal "$output" \ +"thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; text-search-utf8-body-sübjéct (inbox unread)" + +test_done -- 1.7.4.4