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 1C117431E82 for ; Tue, 11 Mar 2014 16:14:44 -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 Dbi1YWtgGtCG for ; Tue, 11 Mar 2014 16:14:39 -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 10CC3431FDF for ; Tue, 11 Mar 2014 16:14:39 -0700 (PDT) Received: from remotemail by yantan.tethera.net with local (Exim 4.80) (envelope-from ) id 1WNVsc-00022X-7h; Tue, 11 Mar 2014 20:14:38 -0300 Received: (nullmailer pid 1247 invoked by uid 1000); Tue, 11 Mar 2014 23:14:34 -0000 From: David Bremner To: notmuch@notmuchmail.org Subject: [PATCH] test: rearrange the test corpus into subfolders, fix tests Date: Tue, 11 Mar 2014 20:14:27 -0300 Message-Id: <1394579667-1179-1-git-send-email-david@tethera.net> X-Mailer: git-send-email 1.8.5.3 In-Reply-To: <1394578900-25618-3-git-send-email-david@tethera.net> References: <1394578900-25618-3-git-send-email-david@tethera.net> 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:14:44 -0000 From: Jani Nikula We will need this for improved folder search tests, but having some folders should exercise our code paths better anyway. Modify the relevant test accordingly to make it pass. This reorganization triggers a bug in the test suite, namely that it expects the output of --output=files to be in a certain order. So we add the fix for that into the same commit. This mainly involves sorting, although the case --duplicate=$n requires more subtlety. --- curses, I forget -M on this the first time which made it 200k test/T090-search-output.sh | 230 +++++++++++++++++---------------- test/corpus/{cur => }/01:2, | 0 test/corpus/{cur => }/02:2, | 0 test/corpus/{cur => bar}/17:2, | 0 test/corpus/{cur => bar}/18:2, | 0 test/corpus/{cur => bar/baz}/05:2, | 0 test/corpus/{cur => bar/baz}/23:2, | 0 test/corpus/{cur => bar/baz}/24:2, | 0 test/corpus/{ => bar/baz}/cur/25:2, | 0 test/corpus/{ => bar/baz}/cur/26:2, | 0 test/corpus/{cur => bar/baz/new}/27:2, | 0 test/corpus/{cur => bar/baz/new}/28:2, | 0 test/corpus/{ => bar}/cur/19:2, | 0 test/corpus/{ => bar}/cur/20:2, | 0 test/corpus/{cur => bar/new}/21:2, | 0 test/corpus/{cur => bar/new}/22:2, | 0 test/corpus/{cur => foo}/06:2, | 0 test/corpus/{cur => foo/baz}/11:2, | 0 test/corpus/{cur => foo/baz}/12:2, | 0 test/corpus/{ => foo/baz}/cur/13:2, | 0 test/corpus/{ => foo/baz}/cur/14:2, | 0 test/corpus/{cur => foo/baz/new}/15:2, | 0 test/corpus/{cur => foo/baz/new}/16:2, | 0 test/corpus/{ => foo}/cur/07:2, | 0 test/corpus/{ => foo}/cur/08:2, | 0 test/corpus/{cur => foo/new}/03:2, | 0 test/corpus/{cur => foo/new}/09:2, | 0 test/corpus/{cur => foo/new}/10:2, | 0 test/corpus/{cur => new}/04:2, | 0 29 files changed, 117 insertions(+), 113 deletions(-) rename test/corpus/{cur => }/01:2, (100%) rename test/corpus/{cur => }/02:2, (100%) rename test/corpus/{cur => bar}/17:2, (100%) rename test/corpus/{cur => bar}/18:2, (100%) rename test/corpus/{cur => bar/baz}/05:2, (100%) rename test/corpus/{cur => bar/baz}/23:2, (100%) rename test/corpus/{cur => bar/baz}/24:2, (100%) rename test/corpus/{ => bar/baz}/cur/25:2, (100%) rename test/corpus/{ => bar/baz}/cur/26:2, (100%) rename test/corpus/{cur => bar/baz/new}/27:2, (100%) rename test/corpus/{cur => bar/baz/new}/28:2, (100%) rename test/corpus/{ => bar}/cur/19:2, (100%) rename test/corpus/{ => bar}/cur/20:2, (100%) rename test/corpus/{cur => bar/new}/21:2, (100%) rename test/corpus/{cur => bar/new}/22:2, (100%) rename test/corpus/{cur => foo}/06:2, (100%) rename test/corpus/{cur => foo/baz}/11:2, (100%) rename test/corpus/{cur => foo/baz}/12:2, (100%) rename test/corpus/{ => foo/baz}/cur/13:2, (100%) rename test/corpus/{ => foo/baz}/cur/14:2, (100%) rename test/corpus/{cur => foo/baz/new}/15:2, (100%) rename test/corpus/{cur => foo/baz/new}/16:2, (100%) rename test/corpus/{ => foo}/cur/07:2, (100%) rename test/corpus/{ => foo}/cur/08:2, (100%) rename test/corpus/{cur => foo/new}/03:2, (100%) rename test/corpus/{cur => foo/new}/09:2, (100%) rename test/corpus/{cur => foo/new}/10:2, (100%) rename test/corpus/{cur => new}/04:2, (100%) diff --git a/test/T090-search-output.sh b/test/T090-search-output.sh index a8ab920..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/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/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/cur/20:2, +MAIL_DIR/bar/new/21:2, +MAIL_DIR/bar/new/22:2, MAIL_DIR/cur/29:2, -MAIL_DIR/cur/28:2, -MAIL_DIR/cur/27:2, -MAIL_DIR/cur/26:2, -MAIL_DIR/cur/25:2, -MAIL_DIR/cur/24:2, -MAIL_DIR/cur/23:2, -MAIL_DIR/cur/22:2, -MAIL_DIR/cur/21:2, -MAIL_DIR/cur/19:2, -MAIL_DIR/cur/18: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/20:2, -MAIL_DIR/cur/17:2, -MAIL_DIR/cur/16:2, -MAIL_DIR/cur/15:2, -MAIL_DIR/cur/14:2, -MAIL_DIR/cur/13:2, -MAIL_DIR/cur/12:2, -MAIL_DIR/cur/11:2, -MAIL_DIR/cur/10:2, -MAIL_DIR/cur/09:2, -MAIL_DIR/cur/08:2, -MAIL_DIR/cur/06:2, -MAIL_DIR/cur/05:2, -MAIL_DIR/cur/04:2, -MAIL_DIR/cur/03:2, -MAIL_DIR/cur/07:2, -MAIL_DIR/cur/02:2, -MAIL_DIR/cur/01: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/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/new/03: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, @@ -266,40 +270,40 @@ MAIL_DIR/cur/32:2, MAIL_DIR/cur/31:2, MAIL_DIR/cur/30:2, MAIL_DIR/cur/29:2, -MAIL_DIR/cur/28:2, -MAIL_DIR/cur/27:2, -MAIL_DIR/cur/26:2, -MAIL_DIR/cur/25:2, -MAIL_DIR/cur/24:2, -MAIL_DIR/cur/23:2, -MAIL_DIR/cur/22:2, -MAIL_DIR/cur/21:2, -MAIL_DIR/cur/19:2, -MAIL_DIR/cur/18:2, -MAIL_DIR/cur/20:2, -MAIL_DIR/cur/17:2, -MAIL_DIR/cur/16:2, -MAIL_DIR/cur/15:2, -MAIL_DIR/cur/14:2, -MAIL_DIR/cur/13:2, -MAIL_DIR/cur/12:2, -MAIL_DIR/cur/11:2, -MAIL_DIR/cur/10:2, -MAIL_DIR/cur/09:2, -MAIL_DIR/cur/08:2, -MAIL_DIR/cur/06:2, -MAIL_DIR/cur/05:2, -MAIL_DIR/cur/04:2, -MAIL_DIR/cur/03:2, -MAIL_DIR/cur/07:2, -MAIL_DIR/cur/02:2, -MAIL_DIR/cur/01: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/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/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/foo/baz/11:2, +MAIL_DIR/foo/new/10:2, +MAIL_DIR/foo/new/09: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, 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,", @@ -324,42 +328,42 @@ cat <EXPECTED "MAIL_DIR/cur/31:2,", "MAIL_DIR/cur/30:2,", "MAIL_DIR/cur/29:2,", -"MAIL_DIR/cur/28:2,", -"MAIL_DIR/cur/27:2,", -"MAIL_DIR/cur/26:2,", -"MAIL_DIR/cur/25:2,", -"MAIL_DIR/cur/24:2,", -"MAIL_DIR/cur/23:2,", -"MAIL_DIR/cur/22:2,", -"MAIL_DIR/cur/21:2,", -"MAIL_DIR/cur/19:2,", -"MAIL_DIR/cur/18: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/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/cur/51:2,", -"MAIL_DIR/cur/20:2,", -"MAIL_DIR/cur/17:2,", -"MAIL_DIR/cur/16:2,", -"MAIL_DIR/cur/15:2,", -"MAIL_DIR/cur/14:2,", -"MAIL_DIR/cur/13:2,", -"MAIL_DIR/cur/12:2,", -"MAIL_DIR/cur/11:2,", -"MAIL_DIR/cur/10:2,", -"MAIL_DIR/cur/09:2,", -"MAIL_DIR/cur/08:2,", -"MAIL_DIR/cur/06:2,", -"MAIL_DIR/cur/05:2,", -"MAIL_DIR/cur/04:2,", -"MAIL_DIR/cur/03:2,", -"MAIL_DIR/cur/07:2,", -"MAIL_DIR/cur/02:2,", -"MAIL_DIR/cur/01: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/foo/baz/11:2,", +"MAIL_DIR/foo/new/10:2,", +"MAIL_DIR/foo/new/09: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,"] EOF 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/corpus/cur/01:2, b/test/corpus/01:2, similarity index 100% rename from test/corpus/cur/01:2, rename to test/corpus/01:2, diff --git a/test/corpus/cur/02:2, b/test/corpus/02:2, similarity index 100% rename from test/corpus/cur/02:2, rename to test/corpus/02:2, diff --git a/test/corpus/cur/17:2, b/test/corpus/bar/17:2, similarity index 100% rename from test/corpus/cur/17:2, rename to test/corpus/bar/17:2, diff --git a/test/corpus/cur/18:2, b/test/corpus/bar/18:2, similarity index 100% rename from test/corpus/cur/18:2, rename to test/corpus/bar/18:2, diff --git a/test/corpus/cur/05:2, b/test/corpus/bar/baz/05:2, similarity index 100% rename from test/corpus/cur/05:2, rename to test/corpus/bar/baz/05:2, diff --git a/test/corpus/cur/23:2, b/test/corpus/bar/baz/23:2, similarity index 100% rename from test/corpus/cur/23:2, rename to test/corpus/bar/baz/23:2, diff --git a/test/corpus/cur/24:2, b/test/corpus/bar/baz/24:2, similarity index 100% rename from test/corpus/cur/24:2, rename to test/corpus/bar/baz/24:2, diff --git a/test/corpus/cur/25:2, b/test/corpus/bar/baz/cur/25:2, similarity index 100% rename from test/corpus/cur/25:2, rename to test/corpus/bar/baz/cur/25:2, diff --git a/test/corpus/cur/26:2, b/test/corpus/bar/baz/cur/26:2, similarity index 100% rename from test/corpus/cur/26:2, rename to test/corpus/bar/baz/cur/26:2, diff --git a/test/corpus/cur/27:2, b/test/corpus/bar/baz/new/27:2, similarity index 100% rename from test/corpus/cur/27:2, rename to test/corpus/bar/baz/new/27:2, diff --git a/test/corpus/cur/28:2, b/test/corpus/bar/baz/new/28:2, similarity index 100% rename from test/corpus/cur/28:2, rename to test/corpus/bar/baz/new/28:2, diff --git a/test/corpus/cur/19:2, b/test/corpus/bar/cur/19:2, similarity index 100% rename from test/corpus/cur/19:2, rename to test/corpus/bar/cur/19:2, diff --git a/test/corpus/cur/20:2, b/test/corpus/bar/cur/20:2, similarity index 100% rename from test/corpus/cur/20:2, rename to test/corpus/bar/cur/20:2, diff --git a/test/corpus/cur/21:2, b/test/corpus/bar/new/21:2, similarity index 100% rename from test/corpus/cur/21:2, rename to test/corpus/bar/new/21:2, diff --git a/test/corpus/cur/22:2, b/test/corpus/bar/new/22:2, similarity index 100% rename from test/corpus/cur/22:2, rename to test/corpus/bar/new/22:2, diff --git a/test/corpus/cur/06:2, b/test/corpus/foo/06:2, similarity index 100% rename from test/corpus/cur/06:2, rename to test/corpus/foo/06:2, diff --git a/test/corpus/cur/11:2, b/test/corpus/foo/baz/11:2, similarity index 100% rename from test/corpus/cur/11:2, rename to test/corpus/foo/baz/11:2, diff --git a/test/corpus/cur/12:2, b/test/corpus/foo/baz/12:2, similarity index 100% rename from test/corpus/cur/12:2, rename to test/corpus/foo/baz/12:2, diff --git a/test/corpus/cur/13:2, b/test/corpus/foo/baz/cur/13:2, similarity index 100% rename from test/corpus/cur/13:2, rename to test/corpus/foo/baz/cur/13:2, diff --git a/test/corpus/cur/14:2, b/test/corpus/foo/baz/cur/14:2, similarity index 100% rename from test/corpus/cur/14:2, rename to test/corpus/foo/baz/cur/14:2, diff --git a/test/corpus/cur/15:2, b/test/corpus/foo/baz/new/15:2, similarity index 100% rename from test/corpus/cur/15:2, rename to test/corpus/foo/baz/new/15:2, diff --git a/test/corpus/cur/16:2, b/test/corpus/foo/baz/new/16:2, similarity index 100% rename from test/corpus/cur/16:2, rename to test/corpus/foo/baz/new/16:2, diff --git a/test/corpus/cur/07:2, b/test/corpus/foo/cur/07:2, similarity index 100% rename from test/corpus/cur/07:2, rename to test/corpus/foo/cur/07:2, diff --git a/test/corpus/cur/08:2, b/test/corpus/foo/cur/08:2, similarity index 100% rename from test/corpus/cur/08:2, rename to test/corpus/foo/cur/08:2, diff --git a/test/corpus/cur/03:2, b/test/corpus/foo/new/03:2, similarity index 100% rename from test/corpus/cur/03:2, rename to test/corpus/foo/new/03:2, diff --git a/test/corpus/cur/09:2, b/test/corpus/foo/new/09:2, similarity index 100% rename from test/corpus/cur/09:2, rename to test/corpus/foo/new/09:2, diff --git a/test/corpus/cur/10:2, b/test/corpus/foo/new/10:2, similarity index 100% rename from test/corpus/cur/10:2, rename to test/corpus/foo/new/10:2, diff --git a/test/corpus/cur/04:2, b/test/corpus/new/04:2, similarity index 100% rename from test/corpus/cur/04:2, rename to test/corpus/new/04:2, -- 1.8.5.3