mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-25 04:18:08 +01:00
5398e6966a
The changes are: - The notmuch-test was split into several files (t000?-*.sh). - Removed helper functions which were moved to test-lib.sh - Replaced every printf with test_expect_success. - Test commands chained with && (test-lib.sh doesn't use "set -e" in order to complete the test suite even if something fails) - Many variables such as ${MAIL_DIR} were properly quoted as they contain spaces. - Changed quoting patterns in add_message and generate_message (single quotes are already used by the test framework). - ${TEST_DIR} replaced by ${PWD} QUICK HOWTO: To run the whole test suite make To run only a single test ./t0001-new.sh To stop on the first error ./t0001-new.sh -i then mail store and database can be inspected in "trash directory.t0001-new" To see the output of tests ./t0001-new.sh -v To not remove trash directory at the end: ./t0001-new.sh -d To run all tests verbosely: make GIT_TEST_OPTS="-v" Signed-off-by: Michal Sojka <sojkam1@fel.cvut.cz>
25 lines
775 B
Bash
Executable file
25 lines
775 B
Bash
Executable file
#!/bin/bash
|
||
test_description="Testing encoding issues"
|
||
. ./test-lib.sh
|
||
|
||
test_expect_success "Message with text of unknown charset" '
|
||
add_message "[content-type]=\"text/plain; charset=unknown-8bit\"" \
|
||
"[body]=irrelevant" &&
|
||
output=$($NOTMUCH show id:${gen_msg_id} 2>&1 | notmuch_show_sanitize) &&
|
||
pass_if_equal "$output" "message{ id:msg-001@notmuch-test-suite depth:0 match:1 filename:/XXX/mail/msg-001
|
||
header{
|
||
Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-05) (inbox unread)
|
||
Subject: Test message #1
|
||
From: Notmuch Test Suite <test_suite@notmuchmail.org>
|
||
To: Notmuch Test Suite <test_suite@notmuchmail.org>
|
||
Date: Tue, 05 Jan 2001 15:43:57 -0800
|
||
header}
|
||
body{
|
||
part{ ID: 1, Content-type: text/plain
|
||
irrelevant
|
||
part}
|
||
body}
|
||
message}"
|
||
'
|
||
|
||
test_done
|