From: David Bremner <david@tethera.net>
To: notmuch@notmuchmail.org
Subject: Re: v6 of boolean folder patches
Date: Tue, 11 Mar 2014 20:10:44 -0300 [thread overview]
Message-ID: <87ha7472mj.fsf@zancas.localnet> (raw)
In-Reply-To: <1394578900-25618-1-git-send-email-david@tethera.net>
David Bremner <david@tethera.net> 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 <<EOF >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 <<EOF >EXPECTED
+notmuch search --output=files --duplicate=1 '*' | notmuch_search_files_sanitize | sort >OUTPUT
+cat <<EOF | sort >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 <<EOF >EXPECTED
+notmuch search --format=json --output=files '*' | notmuch_search_files_sanitize \
+ | test_sort_json >OUTPUT
+cat <<EOF | test_sort_json >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 <<EOF >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 ||
next prev parent reply other threads:[~2014-03-11 23:10 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-11 23:01 v6 of boolean folder patches David Bremner
2014-03-11 23:01 ` [Patch v6 01/14] test: add utility function to sort a json list David Bremner
2014-03-11 23:01 ` [Patch v6 02/14] test: add notmuch_search_files_sanitize and use it David Bremner
2014-03-11 23:14 ` [PATCH] test: rearrange the test corpus into subfolders, fix tests David Bremner
2014-03-11 23:01 ` [Patch v6 04/14] lib: refactor folder term update after filename removal David Bremner
2014-03-11 23:01 ` [Patch v6 05/14] lib: add support for path: prefix searches David Bremner
2014-03-11 23:01 ` [Patch v6 06/14] test: make insert test use the path: prefix David Bremner
2014-03-11 23:01 ` [Patch v6 07/14] lib: make folder: prefix literal David Bremner
2014-03-11 23:01 ` [Patch v6 08/14] test: add tests for the new boolean folder: and path: prefixes David Bremner
2014-03-11 23:01 ` [Patch v6 09/14] test: add database upgrade test from format version 1 to 2 David Bremner
2014-03-11 23:01 ` [Patch v6 10/14] devel: add script to generate test databases David Bremner
2014-03-11 23:01 ` [Patch v6 11/14] test: commit database checksum, ignore actual databases David Bremner
2014-03-11 23:01 ` [Patch v6 12/14] test: add machinery to download and verify databases David Bremner
2014-03-11 23:01 ` [Patch v6 13/14] man: update man pages for folder: and path: search terms David Bremner
2014-03-11 23:01 ` [Patch v6 14/14] man: try to clarify the folder: and path: vs. --output=files confusion David Bremner
2014-03-11 23:10 ` David Bremner [this message]
2014-03-11 23:20 ` v6 of boolean folder patches Austin Clements
2014-03-12 11:23 ` David Bremner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ha7472mj.fsf@zancas.localnet \
--to=david@tethera.net \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).