From 4813ee41d63e8bb6f699303be3123be12dfde3f5 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Mon, 20 Sep 2010 14:36:31 -0700 Subject: test: Print section names, and rename all test sections Now that we can usefully pass section names via the NOTMUCH_SKIP_TESTS environment variable, it's useful to actually print those names out for the user. Then, since we're now printing these names, let's use nicer names, (not excessively long but also not using abbreviations like "msg"). --- test/long-id | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 test/long-id (limited to 'test/long-id') diff --git a/test/long-id b/test/long-id new file mode 100755 index 0000000..1f55d71 --- /dev/null +++ b/test/long-id @@ -0,0 +1,27 @@ +#!/bin/bash +test_description="Testing messages with ridiculously-long message IDs" +. ./test-lib.sh + +test_begin_subtest "Referencing long ID before adding" +generate_message '[subject]="Reference of ridiculously-long message ID"' \ + "[references]=\" +output=$(NOTMUCH_NEW) +test_expect_equal "$output" "Added 1 new message to the database." + +test_begin_subtest "Adding message with long ID" +generate_message '[subject]="A ridiculously-long message ID"' \ + "[id]=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-" +output=$(NOTMUCH_NEW) +test_expect_equal "$output" "Added 1 new message to the database." + +test_begin_subtest "Referencing long ID after adding" +generate_message '[subject]="Reply to ridiculously-long message ID"' \ + "[in-reply-to]=\" +output=$(NOTMUCH_NEW) +test_expect_equal "$output" "Added 1 new message to the database." + +test_begin_subtest "Ensure all messages were threaded together" +output=$($NOTMUCH search 'subject:"a ridiculously-long message ID"' | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-05 [1/3] Notmuch Test Suite; A ridiculously-long message ID (inbox unread)" + +test_done -- cgit v1.2.3