From ef6e066442702c5b742b3a33919c48a8f7ca0ecd Mon Sep 17 00:00:00 2001 From: david Date: Wed, 26 Dec 2012 15:42:43 +2000 Subject: [PATCH] [PATCH 07/11] test/tagging: add tests for exotic tags --- ff/dd413191ffd9cd33e9353d993ebe245f7ee717 | 141 ++++++++++++++++++++++ 1 file changed, 141 insertions(+) create mode 100644 ff/dd413191ffd9cd33e9353d993ebe245f7ee717 diff --git a/ff/dd413191ffd9cd33e9353d993ebe245f7ee717 b/ff/dd413191ffd9cd33e9353d993ebe245f7ee717 new file mode 100644 index 000000000..dc3536f83 --- /dev/null +++ b/ff/dd413191ffd9cd33e9353d993ebe245f7ee717 @@ -0,0 +1,141 @@ +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 7BD5B431FB6 + for ; Tue, 25 Dec 2012 11:43:23 -0800 (PST) +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 e4itNaY3vm8I for ; + Tue, 25 Dec 2012 11:43:21 -0800 (PST) +Received: from tesseract.cs.unb.ca (tesseract.cs.unb.ca [131.202.240.238]) + (using TLSv1 with cipher AES256-SHA (256/256 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 6D87B431FCB + for ; Tue, 25 Dec 2012 11:43:11 -0800 (PST) +Received: from fctnnbsc30w-156034082078.dhcp-dynamic.fibreop.nb.bellaliant.net + ([156.34.82.78] helo=zancas.localnet) + by tesseract.cs.unb.ca with esmtpsa + (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) + (envelope-from ) + id 1TnaP8-0001iJ-KE; Tue, 25 Dec 2012 15:43:10 -0400 +Received: from bremner by zancas.localnet with local (Exim 4.80) + (envelope-from ) + id 1TnaP3-0005nS-3V; Tue, 25 Dec 2012 15:43:05 -0400 +From: david@tethera.net +To: notmuch@notmuchmail.org +Subject: [PATCH 07/11] test/tagging: add tests for exotic tags +Date: Tue, 25 Dec 2012 15:42:43 -0400 +Message-Id: <1356464567-21779-8-git-send-email-david@tethera.net> +X-Mailer: git-send-email 1.7.10.4 +In-Reply-To: <1356464567-21779-1-git-send-email-david@tethera.net> +References: <1356464567-21779-1-git-send-email-david@tethera.net> +X-Spam_bar: - +Cc: 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: Tue, 25 Dec 2012 19:43:24 -0000 + +From: David Bremner + +We test quotes seperately because they matter to the query escaper. +--- + test/tagging | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 66 insertions(+) + +diff --git a/test/tagging b/test/tagging +index 405ad7c..417112b 100755 +--- a/test/tagging ++++ b/test/tagging +@@ -132,6 +132,72 @@ EOF + notmuch restore --format=batch-tag < BACKUP + test_expect_equal_file EXPECTED OUTPUT + ++test_begin_subtest '--batch: tags with quotes' ++notmuch dump --format=batch-tag > BACKUP ++ ++notmuch tag --batch < EXPECTED +++%22%27%22%22%22%27 +inbox +tag5 +unread -- id:msg-001@notmuch-test-suite +++%22%27%22%27%22%22%27%27 +inbox +tag4 +tag5 +unread -- id:msg-002@notmuch-test-suite ++EOF ++ ++notmuch dump --format=batch-tag | sort > OUTPUT ++notmuch restore --format=batch-tag < BACKUP ++test_expect_equal_file EXPECTED OUTPUT ++ ++test_begin_subtest '--batch: tags with punctuation and space' ++notmuch dump --format=batch-tag > BACKUP ++ ++notmuch tag --batch < EXPECTED +++%21@%23%20%24%25%5e%26%2a%29-_=+%5b%7b%5c%20%7c%3b%3a%27%20%22,.%3c%60%7e +inbox +tag4 +tag5 +unread -- id:msg-002@notmuch-test-suite +++%21@%23%20%24%25%5e%26%2a%29-_=+%5b%7b%5c%20%7c%3b%3a%27%20%22,.%3c%60%7e +inbox +tag5 +unread -- id:msg-001@notmuch-test-suite ++EOF ++ ++notmuch dump --format=batch-tag | sort > OUTPUT ++notmuch restore --format=batch-tag < BACKUP ++test_expect_equal_file EXPECTED OUTPUT ++ ++test_begin_subtest '--batch: unicode tags' ++notmuch dump --format=batch-tag > BACKUP ++ ++notmuch tag --batch < EXPECTED +++%2a@%7d%cf%b5%f4%85%80%adO3%da%a7 +=%e0%ac%95%c8%b3+%ef%aa%95%c8%a64w%c7%9d%c9%a2%cf%b3%d6%82%24B%c4%a9%c5%a1UX%ee%99%b0%27E7%ca%a4%d0%8b%5d +A%e1%a0%bc%de%8b%d5%b2V%d9%9b%f3%b5%a2%a3M%d8%a1u@%f0%a0%ac%948%7e%f0%ab%86%af%27 +L%df%85%ef%a1%a5m@%d3%96%c2%ab%d4%9f%ca%b8%f3%b3%a2%bf%c7%b1_u%d7%b4%c7%b1 +P%c4%98%2f +R +inbox +tag4 +tag5 +unread +%7e%d1%8b%25%ec%a0%ae%d1%a0M%3b%e3%b6%b7%e9%a4%87%3c%db%9a%cc%a8%e1%96%9d +%c4%bf7%c7%ab9H%c4%99k%ea%91%bd%c3%8ck%e2%b3%8dk%c5%952V%e4%99%b2%d9%b3%e4%8b%bda%5b%24%c7%9b +%da%88=f%cc%b9I%ce%af%7b%c9%97%e3%b9%8bH%cb%92X%d2%8c6 +%dc%9crh%d2%86B%e5%97%a2%22t%ed%99%82d -- id:msg-002@notmuch-test-suite +++%2a@%7d%cf%b5%f4%85%80%adO3%da%a7 +=%e0%ac%95%c8%b3+%ef%aa%95%c8%a64w%c7%9d%c9%a2%cf%b3%d6%82%24B%c4%a9%c5%a1UX%ee%99%b0%27E7%ca%a4%d0%8b%5d +A%e1%a0%bc%de%8b%d5%b2V%d9%9b%f3%b5%a2%a3M%d8%a1u@%f0%a0%ac%948%7e%f0%ab%86%af%27 +L%df%85%ef%a1%a5m@%d3%96%c2%ab%d4%9f%ca%b8%f3%b3%a2%bf%c7%b1_u%d7%b4%c7%b1 +P%c4%98%2f +R +inbox +tag5 +unread +%7e%d1%8b%25%ec%a0%ae%d1%a0M%3b%e3%b6%b7%e9%a4%87%3c%db%9a%cc%a8%e1%96%9d +%c4%bf7%c7%ab9H%c4%99k%ea%91%bd%c3%8ck%e2%b3%8dk%c5%952V%e4%99%b2%d9%b3%e4%8b%bda%5b%24%c7%9b +%da%88=f%cc%b9I%ce%af%7b%c9%97%e3%b9%8bH%cb%92X%d2%8c6 +%dc%9crh%d2%86B%e5%97%a2%22t%ed%99%82d -- id:msg-001@notmuch-test-suite ++EOF ++ ++notmuch dump --format=batch-tag | sort > OUTPUT ++notmuch restore --format=batch-tag < BACKUP ++test_expect_equal_file EXPECTED OUTPUT ++ + test_expect_code 1 "Empty tag names" 'notmuch tag + One' + + test_expect_code 1 "Tag name beginning with -" 'notmuch tag +- One' +-- +1.7.10.4 + -- 2.26.2