mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-25 12:28:09 +01:00
test: Add test for searching of uncommonly encoded messages
Emails that are encoded differently than as ASCII or UTF-8 are not indexed properly by notmuch. It is not possible to search for non-ASCII words within those messages.
This commit is contained in:
parent
13235d3535
commit
74f8f15adc
2 changed files with 14 additions and 0 deletions
|
@ -21,4 +21,13 @@ irrelevant
|
||||||
body}
|
body}
|
||||||
message}"
|
message}"
|
||||||
|
|
||||||
|
test_begin_subtest "Search for ISO-8859-2 encoded message"
|
||||||
|
test_subtest_known_broken
|
||||||
|
add_message '[content-type]="text/plain; charset=iso-8859-2"' \
|
||||||
|
'[content-transfer-encoding]=8bit' \
|
||||||
|
'[subject]="ISO-8859-2 encoded message"' \
|
||||||
|
"[body]=$'Czech word tu\350\362\341\350\350\355 means pinguin\'s.'" # ISO-8859-2 characters are generated by shell's escape sequences
|
||||||
|
output=$(notmuch search tučňáččí 2>&1 | notmuch_show_sanitize)
|
||||||
|
test_expect_equal "$output" "thread:0000000000000002 2001-01-05 [1/1] Notmuch Test Suite; ISO-8859-2 encoded message (inbox unread)"
|
||||||
|
|
||||||
test_done
|
test_done
|
||||||
|
|
|
@ -356,6 +356,11 @@ ${additional_headers}"
|
||||||
${additional_headers}"
|
${additional_headers}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ ! -z "${template[content-transfer-encoding]}" ]; then
|
||||||
|
additional_headers="Content-Transfer-Encoding: ${template[content-transfer-encoding]}
|
||||||
|
${additional_headers}"
|
||||||
|
fi
|
||||||
|
|
||||||
# Note that in the way we're setting it above and using it below,
|
# Note that in the way we're setting it above and using it below,
|
||||||
# `additional_headers' will also serve as the header / body separator
|
# `additional_headers' will also serve as the header / body separator
|
||||||
# (empty line in between).
|
# (empty line in between).
|
||||||
|
|
Loading…
Reference in a new issue