X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=test%2FT356-protected-headers.sh;h=fee3b043d5143a2af88660f30a917e2cc6781f2d;hb=5c3a44681f2fffbd3a7d76e424c134a82470ddd2;hp=ff37f6bdc1fc883072d63f16bb4f5066478afdd1;hpb=b7b553e732baed620f6688570829a4d46dd5f6e5;p=notmuch diff --git a/test/T356-protected-headers.sh b/test/T356-protected-headers.sh index ff37f6bd..fee3b043 100755 --- a/test/T356-protected-headers.sh +++ b/test/T356-protected-headers.sh @@ -83,4 +83,20 @@ test_json_nodes <<<"$output" \ 'subject:["original"]["headers"]["Subject"]="This is a protected header"' \ 'reply-subject:["reply-headers"]["Subject"]="Re: Subject Unavailable"' +test_begin_subtest "protected subject is not indexed by default" +output=$(notmuch search --output=messages 'subject:"This is a protected header"') +test_expect_equal "$output" '' + +test_begin_subtest "reindex message with protected header" +test_expect_success 'notmuch reindex --decrypt=true id:protected-header@crypto.notmuchmail.org' + +test_begin_subtest "protected subject is indexed when cleartext is indexed" +output=$(notmuch search --output=messages 'subject:"This is a protected header"') +test_expect_equal "$output" 'id:protected-header@crypto.notmuchmail.org' + +test_begin_subtest "indexed protected subject is visible in search" +output=$(notmuch search --format=json 'id:protected-header@crypto.notmuchmail.org') +test_json_nodes <<<"$output" \ + 'subject:[0]["subject"]="This is a protected header"' + test_done