mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-22 10:58:10 +01:00
test: rearrange the test corpus into subfolders, fix tests
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.
This commit is contained in:
parent
7630f300ba
commit
ded713c39d
29 changed files with 117 additions and 113 deletions
|
@ -181,67 +181,71 @@ EOF
|
||||||
test_expect_equal_file OUTPUT EXPECTED
|
test_expect_equal_file OUTPUT EXPECTED
|
||||||
|
|
||||||
test_begin_subtest "--output=files"
|
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
|
cat <<EOF >EXPECTED
|
||||||
|
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/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/52:2,
|
||||||
MAIL_DIR/cur/53:2,
|
MAIL_DIR/cur/53:2,
|
||||||
MAIL_DIR/cur/50:2,
|
MAIL_DIR/foo/06:2,
|
||||||
MAIL_DIR/cur/49:2,
|
MAIL_DIR/foo/baz/11:2,
|
||||||
MAIL_DIR/cur/48:2,
|
MAIL_DIR/foo/baz/12:2,
|
||||||
MAIL_DIR/cur/47:2,
|
MAIL_DIR/foo/baz/cur/13:2,
|
||||||
MAIL_DIR/cur/46:2,
|
MAIL_DIR/foo/baz/cur/14:2,
|
||||||
MAIL_DIR/cur/45:2,
|
MAIL_DIR/foo/baz/new/15:2,
|
||||||
MAIL_DIR/cur/44:2,
|
MAIL_DIR/foo/baz/new/16:2,
|
||||||
MAIL_DIR/cur/43:2,
|
MAIL_DIR/foo/cur/07:2,
|
||||||
MAIL_DIR/cur/42:2,
|
MAIL_DIR/foo/cur/08:2,
|
||||||
MAIL_DIR/cur/41:2,
|
MAIL_DIR/foo/new/03:2,
|
||||||
MAIL_DIR/cur/40:2,
|
MAIL_DIR/foo/new/09:2,
|
||||||
MAIL_DIR/cur/39:2,
|
MAIL_DIR/foo/new/10:2,
|
||||||
MAIL_DIR/cur/38:2,
|
MAIL_DIR/new/04: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/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/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,
|
|
||||||
EOF
|
EOF
|
||||||
test_expect_equal_file OUTPUT EXPECTED
|
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"
|
test_begin_subtest "--output=files --duplicate=1"
|
||||||
notmuch search --output=files --duplicate=1 '*' | notmuch_search_files_sanitize >OUTPUT
|
notmuch search --output=files --duplicate=1 '*' | notmuch_search_files_sanitize | sort >OUTPUT
|
||||||
cat <<EOF >EXPECTED
|
cat <<EOF | sort >EXPECTED
|
||||||
|
$dup1
|
||||||
MAIL_DIR/cur/52:2,
|
MAIL_DIR/cur/52:2,
|
||||||
MAIL_DIR/cur/53:2,
|
MAIL_DIR/cur/53:2,
|
||||||
MAIL_DIR/cur/50:2,
|
MAIL_DIR/cur/50:2,
|
||||||
|
@ -266,40 +270,40 @@ MAIL_DIR/cur/32:2,
|
||||||
MAIL_DIR/cur/31:2,
|
MAIL_DIR/cur/31:2,
|
||||||
MAIL_DIR/cur/30:2,
|
MAIL_DIR/cur/30:2,
|
||||||
MAIL_DIR/cur/29:2,
|
MAIL_DIR/cur/29:2,
|
||||||
MAIL_DIR/cur/28:2,
|
MAIL_DIR/bar/baz/new/28:2,
|
||||||
MAIL_DIR/cur/27:2,
|
MAIL_DIR/bar/baz/new/27:2,
|
||||||
MAIL_DIR/cur/26:2,
|
MAIL_DIR/bar/baz/cur/26:2,
|
||||||
MAIL_DIR/cur/25:2,
|
MAIL_DIR/bar/baz/cur/25:2,
|
||||||
MAIL_DIR/cur/24:2,
|
MAIL_DIR/bar/baz/24:2,
|
||||||
MAIL_DIR/cur/23:2,
|
MAIL_DIR/bar/baz/23:2,
|
||||||
MAIL_DIR/cur/22:2,
|
MAIL_DIR/bar/new/22:2,
|
||||||
MAIL_DIR/cur/21:2,
|
MAIL_DIR/bar/new/21:2,
|
||||||
MAIL_DIR/cur/19:2,
|
MAIL_DIR/bar/cur/19:2,
|
||||||
MAIL_DIR/cur/18:2,
|
MAIL_DIR/bar/cur/20:2,
|
||||||
MAIL_DIR/cur/20:2,
|
MAIL_DIR/bar/17:2,
|
||||||
MAIL_DIR/cur/17:2,
|
MAIL_DIR/foo/baz/new/16:2,
|
||||||
MAIL_DIR/cur/16:2,
|
MAIL_DIR/foo/baz/new/15:2,
|
||||||
MAIL_DIR/cur/15:2,
|
MAIL_DIR/foo/baz/cur/14:2,
|
||||||
MAIL_DIR/cur/14:2,
|
MAIL_DIR/foo/baz/cur/13:2,
|
||||||
MAIL_DIR/cur/13:2,
|
MAIL_DIR/foo/baz/12:2,
|
||||||
MAIL_DIR/cur/12:2,
|
MAIL_DIR/foo/baz/11:2,
|
||||||
MAIL_DIR/cur/11:2,
|
MAIL_DIR/foo/new/10:2,
|
||||||
MAIL_DIR/cur/10:2,
|
MAIL_DIR/foo/new/09:2,
|
||||||
MAIL_DIR/cur/09:2,
|
MAIL_DIR/foo/cur/08:2,
|
||||||
MAIL_DIR/cur/08:2,
|
MAIL_DIR/foo/06:2,
|
||||||
MAIL_DIR/cur/06:2,
|
MAIL_DIR/bar/baz/05:2,
|
||||||
MAIL_DIR/cur/05:2,
|
MAIL_DIR/new/04:2,
|
||||||
MAIL_DIR/cur/04:2,
|
MAIL_DIR/foo/new/03:2,
|
||||||
MAIL_DIR/cur/03:2,
|
MAIL_DIR/foo/cur/07:2,
|
||||||
MAIL_DIR/cur/07:2,
|
MAIL_DIR/02:2,
|
||||||
MAIL_DIR/cur/02:2,
|
MAIL_DIR/01:2,
|
||||||
MAIL_DIR/cur/01:2,
|
|
||||||
EOF
|
EOF
|
||||||
test_expect_equal_file OUTPUT EXPECTED
|
test_expect_equal_file OUTPUT EXPECTED
|
||||||
|
|
||||||
test_begin_subtest "--output=files --format=json"
|
test_begin_subtest "--output=files --format=json"
|
||||||
notmuch search --format=json --output=files '*' | notmuch_search_files_sanitize >OUTPUT
|
notmuch search --format=json --output=files '*' | notmuch_search_files_sanitize \
|
||||||
cat <<EOF >EXPECTED
|
| test_sort_json >OUTPUT
|
||||||
|
cat <<EOF | test_sort_json >EXPECTED
|
||||||
["MAIL_DIR/cur/52:2,",
|
["MAIL_DIR/cur/52:2,",
|
||||||
"MAIL_DIR/cur/53:2,",
|
"MAIL_DIR/cur/53:2,",
|
||||||
"MAIL_DIR/cur/50:2,",
|
"MAIL_DIR/cur/50:2,",
|
||||||
|
@ -324,42 +328,42 @@ cat <<EOF >EXPECTED
|
||||||
"MAIL_DIR/cur/31:2,",
|
"MAIL_DIR/cur/31:2,",
|
||||||
"MAIL_DIR/cur/30:2,",
|
"MAIL_DIR/cur/30:2,",
|
||||||
"MAIL_DIR/cur/29:2,",
|
"MAIL_DIR/cur/29:2,",
|
||||||
"MAIL_DIR/cur/28:2,",
|
"MAIL_DIR/bar/baz/new/28:2,",
|
||||||
"MAIL_DIR/cur/27:2,",
|
"MAIL_DIR/bar/baz/new/27:2,",
|
||||||
"MAIL_DIR/cur/26:2,",
|
"MAIL_DIR/bar/baz/cur/26:2,",
|
||||||
"MAIL_DIR/cur/25:2,",
|
"MAIL_DIR/bar/baz/cur/25:2,",
|
||||||
"MAIL_DIR/cur/24:2,",
|
"MAIL_DIR/bar/baz/24:2,",
|
||||||
"MAIL_DIR/cur/23:2,",
|
"MAIL_DIR/bar/baz/23:2,",
|
||||||
"MAIL_DIR/cur/22:2,",
|
"MAIL_DIR/bar/new/22:2,",
|
||||||
"MAIL_DIR/cur/21:2,",
|
"MAIL_DIR/bar/new/21:2,",
|
||||||
"MAIL_DIR/cur/19:2,",
|
"MAIL_DIR/bar/cur/19:2,",
|
||||||
"MAIL_DIR/cur/18:2,",
|
"MAIL_DIR/bar/18:2,",
|
||||||
"MAIL_DIR/cur/51:2,",
|
"MAIL_DIR/cur/51:2,",
|
||||||
"MAIL_DIR/cur/20:2,",
|
"MAIL_DIR/bar/cur/20:2,",
|
||||||
"MAIL_DIR/cur/17:2,",
|
"MAIL_DIR/bar/17:2,",
|
||||||
"MAIL_DIR/cur/16:2,",
|
"MAIL_DIR/foo/baz/new/16:2,",
|
||||||
"MAIL_DIR/cur/15:2,",
|
"MAIL_DIR/foo/baz/new/15:2,",
|
||||||
"MAIL_DIR/cur/14:2,",
|
"MAIL_DIR/foo/baz/cur/14:2,",
|
||||||
"MAIL_DIR/cur/13:2,",
|
"MAIL_DIR/foo/baz/cur/13:2,",
|
||||||
"MAIL_DIR/cur/12:2,",
|
"MAIL_DIR/foo/baz/12:2,",
|
||||||
"MAIL_DIR/cur/11:2,",
|
"MAIL_DIR/foo/baz/11:2,",
|
||||||
"MAIL_DIR/cur/10:2,",
|
"MAIL_DIR/foo/new/10:2,",
|
||||||
"MAIL_DIR/cur/09:2,",
|
"MAIL_DIR/foo/new/09:2,",
|
||||||
"MAIL_DIR/cur/08:2,",
|
"MAIL_DIR/foo/cur/08:2,",
|
||||||
"MAIL_DIR/cur/06:2,",
|
"MAIL_DIR/foo/06:2,",
|
||||||
"MAIL_DIR/cur/05:2,",
|
"MAIL_DIR/bar/baz/05:2,",
|
||||||
"MAIL_DIR/cur/04:2,",
|
"MAIL_DIR/new/04:2,",
|
||||||
"MAIL_DIR/cur/03:2,",
|
"MAIL_DIR/foo/new/03:2,",
|
||||||
"MAIL_DIR/cur/07:2,",
|
"MAIL_DIR/foo/cur/07:2,",
|
||||||
"MAIL_DIR/cur/02:2,",
|
"MAIL_DIR/02:2,",
|
||||||
"MAIL_DIR/cur/01:2,"]
|
"MAIL_DIR/01:2,"]
|
||||||
EOF
|
EOF
|
||||||
test_expect_equal_file OUTPUT EXPECTED
|
test_expect_equal_file OUTPUT EXPECTED
|
||||||
|
|
||||||
test_begin_subtest "--output=files --format=json --duplicate=2"
|
test_begin_subtest "--output=files --format=json --duplicate=2"
|
||||||
notmuch search --format=json --output=files --duplicate=2 '*' | notmuch_search_files_sanitize >OUTPUT
|
notmuch search --format=json --output=files --duplicate=2 '*' | notmuch_search_files_sanitize >OUTPUT
|
||||||
cat <<EOF >EXPECTED
|
cat <<EOF >EXPECTED
|
||||||
["MAIL_DIR/cur/51:2,"]
|
["$dup2"]
|
||||||
EOF
|
EOF
|
||||||
test_expect_equal_file OUTPUT EXPECTED
|
test_expect_equal_file OUTPUT EXPECTED
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue