From 4ad9d1dfebe48bec128b0ad0cbe8a2fc6d928705 Mon Sep 17 00:00:00 2001 From: david Date: Sun, 19 Aug 2012 15:18:34 +0200 Subject: [PATCH] [Patch v3 6/6] test: add broken roundtrip test --- 72/d0f5baad1e542337e55c292b69a43136224ef3 | 84 +++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 72/d0f5baad1e542337e55c292b69a43136224ef3 diff --git a/72/d0f5baad1e542337e55c292b69a43136224ef3 b/72/d0f5baad1e542337e55c292b69a43136224ef3 new file mode 100644 index 000000000..9a12f3264 --- /dev/null +++ b/72/d0f5baad1e542337e55c292b69a43136224ef3 @@ -0,0 +1,84 @@ +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 D8149431FC2 + for ; Mon, 20 Aug 2012 00:19:02 -0700 (PDT) +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 315sbWemWGvH for ; + Mon, 20 Aug 2012 00:19:01 -0700 (PDT) +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 A02C2431FC3 + for ; Mon, 20 Aug 2012 00:18:55 -0700 (PDT) +Received: from remotemail by tesseract.cs.unb.ca with local (Exim 4.72) + (envelope-from ) + id 1T3MGE-0002Go-TW; Mon, 20 Aug 2012 04:18:55 -0300 +Received: (nullmailer pid 7820 invoked by uid 1000); + Sun, 19 Aug 2012 13:19:07 -0000 +From: david@tethera.net +To: notmuch@notmuchmail.org +Subject: [Patch v3 6/6] test: add broken roundtrip test +Date: Sun, 19 Aug 2012 15:18:34 +0200 +Message-Id: <1345382314-5330-7-git-send-email-david@tethera.net> +X-Mailer: git-send-email 1.7.10.4 +In-Reply-To: <1345382314-5330-1-git-send-email-david@tethera.net> +References: <1345382314-5330-1-git-send-email-david@tethera.net> +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: Mon, 20 Aug 2012 07:19:03 -0000 + +From: David Bremner + +We demonstrate the current notmuch restore parser being confused by +message-id's and tags containing non alpha numeric characters +(particularly space and parentheses are problematic because they are +not escaped by notmuch dump). + +We save the files as hex escaped on disk so that the output from the +failing test will not confuse the terminal emulator of people running +the test. +--- + test/dump-restore | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/test/dump-restore b/test/dump-restore +index f25f7cf..218c9b7 100755 +--- a/test/dump-restore ++++ b/test/dump-restore +@@ -78,4 +78,13 @@ test_begin_subtest "dump --output=outfile -- from:cworth" + notmuch dump --output=dump-outfile-dash-inbox.actual -- from:cworth + test_expect_equal_file dump-cworth.expected dump-outfile-dash-inbox.actual + ++test_expect_success 'roundtripping random message-ids and tags' \ ++ 'test_subtest_known_broken && ++ ${TEST_DIRECTORY}/random-corpus --num-messages=10 --config-path=${NOTMUCH_CONFIG} && ++ notmuch dump | ${TEST_DIRECTORY}/hex-xcode --direction=encode > EXPECTED.$test_count && ++ notmuch tag -random-corpus tag:random-corpus && ++ ${TEST_DIRECTORY}/hex-xcode --direction=decode < EXPECTED.$test_count | notmuch restore 2>/dev/null && ++ notmuch dump | ${TEST_DIRECTORY}/hex-xcode --direction=encode > OUTPUT.$test_count && ++ test_cmp EXPECTED.$test_count OUTPUT.$test_count' ++ + test_done +-- +1.7.10.4 + -- 2.26.2