From 6b9375038edc383100e85330a005574112b44019 Mon Sep 17 00:00:00 2001 From: David Bremner Date: Wed, 12 Mar 2014 20:10:44 +2100 Subject: [PATCH] Re: v6 of boolean folder patches --- 8b/ec03c1aa40ca909ab4110f124289f358d9812b | 278 ++++++++++++++++++++++ 1 file changed, 278 insertions(+) create mode 100644 8b/ec03c1aa40ca909ab4110f124289f358d9812b diff --git a/8b/ec03c1aa40ca909ab4110f124289f358d9812b b/8b/ec03c1aa40ca909ab4110f124289f358d9812b new file mode 100644 index 000000000..d404523ea --- /dev/null +++ b/8b/ec03c1aa40ca909ab4110f124289f358d9812b @@ -0,0 +1,278 @@ +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 0EF45431FDF + for ; Tue, 11 Mar 2014 16:10:52 -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 en4FYipgPrcJ for ; + Tue, 11 Mar 2014 16:10:48 -0700 (PDT) +Received: from yantan.tethera.net (yantan.tethera.net [199.188.72.155]) + (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 9A7B2429E29 + for ; Tue, 11 Mar 2014 16:10:48 -0700 (PDT) +Received: from remotemail by yantan.tethera.net with local (Exim 4.80) + (envelope-from ) + id 1WNVou-00021R-6j; Tue, 11 Mar 2014 20:10:48 -0300 +Received: (nullmailer pid 923 invoked by uid 1000); Tue, 11 Mar 2014 23:10:44 + -0000 +From: David Bremner +To: notmuch@notmuchmail.org +Subject: Re: v6 of boolean folder patches +In-Reply-To: <1394578900-25618-1-git-send-email-david@tethera.net> +References: <1394578900-25618-1-git-send-email-david@tethera.net> +User-Agent: Notmuch/0.17+120~gccab40f (http://notmuchmail.org) Emacs/24.3.1 + (x86_64-pc-linux-gnu) +Date: Tue, 11 Mar 2014 20:10:44 -0300 +Message-ID: <87ha7472mj.fsf@zancas.localnet> +MIME-Version: 1.0 +Content-Type: text/plain +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, 11 Mar 2014 23:10:52 -0000 + +David Bremner writes: + +> +> Here's a diffstat +> +> test/T090-search-output.sh | 112 +++++++++++++------------- +> test/T530-upgrade.sh | 26 +++--- +> test/test-databases/Makefile.local | 2 +- +> test/test-databases/database-v1.tar.xz.sha256 | 1 + +> test/test-databases/folders-v1.tar.xz.sha256 | 1 - +> test/test-lib.sh | 6 ++ +> 6 files changed, 77 insertions(+), 71 deletions(-) + +by request, a real diff + +diff --git a/test/T090-search-output.sh b/test/T090-search-output.sh +index e0bf8c1..947d572 100755 +--- a/test/T090-search-output.sh ++++ b/test/T090-search-output.sh +@@ -181,67 +181,71 @@ EOF + test_expect_equal_file OUTPUT EXPECTED + + test_begin_subtest "--output=files" +-notmuch search --output=files '*' | notmuch_search_files_sanitize >OUTPUT ++notmuch search --output=files '*' | notmuch_search_files_sanitize | sort >OUTPUT + cat <EXPECTED +-MAIL_DIR/cur/52:2, +-MAIL_DIR/cur/53:2, +-MAIL_DIR/cur/50:2, +-MAIL_DIR/cur/49:2, +-MAIL_DIR/cur/48:2, +-MAIL_DIR/cur/47:2, +-MAIL_DIR/cur/46:2, +-MAIL_DIR/cur/45:2, +-MAIL_DIR/cur/44:2, +-MAIL_DIR/cur/43:2, +-MAIL_DIR/cur/42:2, +-MAIL_DIR/cur/41:2, +-MAIL_DIR/cur/40:2, +-MAIL_DIR/cur/39:2, +-MAIL_DIR/cur/38:2, +-MAIL_DIR/cur/37:2, +-MAIL_DIR/cur/36:2, +-MAIL_DIR/cur/35:2, +-MAIL_DIR/cur/34:2, +-MAIL_DIR/cur/33:2, +-MAIL_DIR/cur/32:2, +-MAIL_DIR/cur/31:2, +-MAIL_DIR/cur/30:2, +-MAIL_DIR/cur/29:2, +-MAIL_DIR/bar/baz/new/28:2, +-MAIL_DIR/bar/baz/new/27:2, +-MAIL_DIR/bar/baz/cur/26:2, +-MAIL_DIR/bar/baz/cur/25:2, +-MAIL_DIR/bar/baz/24:2, ++MAIL_DIR/01:2, ++MAIL_DIR/02:2, ++MAIL_DIR/bar/17:2, ++MAIL_DIR/bar/18:2, ++MAIL_DIR/bar/baz/05:2, + MAIL_DIR/bar/baz/23:2, +-MAIL_DIR/bar/new/22:2, +-MAIL_DIR/bar/new/21:2, ++MAIL_DIR/bar/baz/24:2, ++MAIL_DIR/bar/baz/cur/25:2, ++MAIL_DIR/bar/baz/cur/26:2, ++MAIL_DIR/bar/baz/new/27:2, ++MAIL_DIR/bar/baz/new/28:2, + MAIL_DIR/bar/cur/19:2, +-MAIL_DIR/bar/18:2, +-MAIL_DIR/cur/51:2, + MAIL_DIR/bar/cur/20:2, +-MAIL_DIR/bar/17:2, +-MAIL_DIR/foo/baz/new/16:2, +-MAIL_DIR/foo/baz/new/15:2, +-MAIL_DIR/foo/baz/cur/14:2, +-MAIL_DIR/foo/baz/cur/13:2, +-MAIL_DIR/foo/baz/12:2, ++MAIL_DIR/bar/new/21:2, ++MAIL_DIR/bar/new/22:2, ++MAIL_DIR/cur/29:2, ++MAIL_DIR/cur/30:2, ++MAIL_DIR/cur/31:2, ++MAIL_DIR/cur/32:2, ++MAIL_DIR/cur/33:2, ++MAIL_DIR/cur/34:2, ++MAIL_DIR/cur/35:2, ++MAIL_DIR/cur/36:2, ++MAIL_DIR/cur/37:2, ++MAIL_DIR/cur/38:2, ++MAIL_DIR/cur/39:2, ++MAIL_DIR/cur/40:2, ++MAIL_DIR/cur/41:2, ++MAIL_DIR/cur/42:2, ++MAIL_DIR/cur/43:2, ++MAIL_DIR/cur/44:2, ++MAIL_DIR/cur/45:2, ++MAIL_DIR/cur/46:2, ++MAIL_DIR/cur/47:2, ++MAIL_DIR/cur/48:2, ++MAIL_DIR/cur/49:2, ++MAIL_DIR/cur/50:2, ++MAIL_DIR/cur/51:2, ++MAIL_DIR/cur/52:2, ++MAIL_DIR/cur/53:2, ++MAIL_DIR/foo/06:2, + MAIL_DIR/foo/baz/11:2, +-MAIL_DIR/foo/new/10:2, +-MAIL_DIR/foo/new/09:2, ++MAIL_DIR/foo/baz/12:2, ++MAIL_DIR/foo/baz/cur/13:2, ++MAIL_DIR/foo/baz/cur/14:2, ++MAIL_DIR/foo/baz/new/15:2, ++MAIL_DIR/foo/baz/new/16:2, ++MAIL_DIR/foo/cur/07:2, + MAIL_DIR/foo/cur/08:2, +-MAIL_DIR/foo/06:2, +-MAIL_DIR/bar/baz/05:2, +-MAIL_DIR/new/04:2, + MAIL_DIR/foo/new/03:2, +-MAIL_DIR/foo/cur/07:2, +-MAIL_DIR/02:2, +-MAIL_DIR/01:2, ++MAIL_DIR/foo/new/09:2, ++MAIL_DIR/foo/new/10:2, ++MAIL_DIR/new/04:2, + EOF + test_expect_equal_file OUTPUT EXPECTED + ++dup1=$(notmuch search --output=files id:20091117232137.GA7669@griffis1.net | head -n 1 | sed -e "s,$MAIL_DIR,MAIL_DIR,") ++dup2=$(notmuch search --output=files id:20091117232137.GA7669@griffis1.net | tail -n 1 | sed -e "s,$MAIL_DIR,MAIL_DIR,") ++ + test_begin_subtest "--output=files --duplicate=1" +-notmuch search --output=files --duplicate=1 '*' | notmuch_search_files_sanitize >OUTPUT +-cat <EXPECTED ++notmuch search --output=files --duplicate=1 '*' | notmuch_search_files_sanitize | sort >OUTPUT ++cat <EXPECTED ++$dup1 + MAIL_DIR/cur/52:2, + MAIL_DIR/cur/53:2, + MAIL_DIR/cur/50:2, +@@ -275,7 +279,6 @@ MAIL_DIR/bar/baz/23:2, + MAIL_DIR/bar/new/22:2, + MAIL_DIR/bar/new/21:2, + MAIL_DIR/bar/cur/19:2, +-MAIL_DIR/bar/18:2, + MAIL_DIR/bar/cur/20:2, + MAIL_DIR/bar/17:2, + MAIL_DIR/foo/baz/new/16:2, +@@ -298,8 +301,9 @@ EOF + test_expect_equal_file OUTPUT EXPECTED + + test_begin_subtest "--output=files --format=json" +-notmuch search --format=json --output=files '*' | notmuch_search_files_sanitize >OUTPUT +-cat <EXPECTED ++notmuch search --format=json --output=files '*' | notmuch_search_files_sanitize \ ++ | test_sort_json >OUTPUT ++cat <EXPECTED + ["MAIL_DIR/cur/52:2,", + "MAIL_DIR/cur/53:2,", + "MAIL_DIR/cur/50:2,", +@@ -359,7 +363,7 @@ test_expect_equal_file OUTPUT EXPECTED + test_begin_subtest "--output=files --format=json --duplicate=2" + notmuch search --format=json --output=files --duplicate=2 '*' | notmuch_search_files_sanitize >OUTPUT + cat <EXPECTED +-["MAIL_DIR/cur/51:2,"] ++["$dup2"] + EOF + test_expect_equal_file OUTPUT EXPECTED + +diff --git a/test/T530-upgrade.sh b/test/T530-upgrade.sh +index 56cee02..67bbf31 100755 +--- a/test/T530-upgrade.sh ++++ b/test/T530-upgrade.sh +@@ -3,7 +3,7 @@ test_description="database upgrade" + + . ./test-lib.sh + +-dbtarball=folders-v1.tar.xz ++dbtarball=database-v1.tar.xz + + # XXX: Accomplish the same with test lib helpers + if [ ! -e ${TEST_DIRECTORY}/test-databases/${dbtarball} ]; then +diff --git a/test/test-databases/Makefile.local b/test/test-databases/Makefile.local +index e777ada..0572e78 100644 +--- a/test/test-databases/Makefile.local ++++ b/test/test-databases/Makefile.local +@@ -4,7 +4,7 @@ TEST_DATABASE_MIRROR=http://notmuchmail.org/releases/test-databases + + dir := test/test-databases + +-test_databases := $(dir)/folders-v1.tar.xz ++test_databases := $(dir)/database-v1.tar.xz + + %.tar.xz: + wget -nv -O $@ ${TEST_DATABASE_MIRROR}/$(notdir $@); +diff --git a/test/test-databases/database-v1.tar.xz.sha256 b/test/test-databases/database-v1.tar.xz.sha256 +new file mode 100644 +index 0000000..2cc4f96 +--- /dev/null ++++ b/test/test-databases/database-v1.tar.xz.sha256 +@@ -0,0 +1 @@ ++4299e051b10e1fa7b33ea2862790a09ebfe96859681804e5251e130f800e69d2 database-v1.tar.xz +diff --git a/test/test-databases/folders-v1.tar.xz.sha256 b/test/test-databases/folders-v1.tar.xz.sha256 +deleted file mode 100644 +index 01ad79d..0000000 +--- a/test/test-databases/folders-v1.tar.xz.sha256 ++++ /dev/null +@@ -1 +0,0 @@ +-ace8a61216756b90a421e23d03910e1228bcb910e197c35e51e29f2cf57b37d9 folders-v1.tar.xz +diff --git a/test/test-lib.sh b/test/test-lib.sh +index 837c669..8697d6a 100644 +--- a/test/test-lib.sh ++++ b/test/test-lib.sh +@@ -622,6 +622,12 @@ test_expect_equal_json () { + test_expect_equal "$output" "$expected" "$@" + } + ++# Sort the top-level list of JSON data from stdin. ++test_sort_json () { ++ PYTHONIOENCODING=utf-8 python -c \ ++ "import sys, json; json.dump(sorted(json.load(sys.stdin)),sys.stdout)" ++} ++ + test_emacs_expect_t () { + test "$#" = 2 && { prereq=$1; shift; } || prereq= + test "$#" = 1 || -- 2.26.2