The extra space is mainly just untidy.
"Another Name"
test_begin_subtest "Top level --config<space>FILE option"
-test_expect_equal "$(notmuch --config alt-config config get user.name)" \
+test_expect_equal "$(notmuch --config alt-config config get user.name)" \
"Another Name"
test_begin_subtest "Top level --config=FILE option changed the right file"
test_begin_subtest "Xapian exception: read only files"
-chmod u-w ${MAIL_DIR}/.notmuch/xapian/*.*
+chmod u-w ${MAIL_DIR}/.notmuch/xapian/*.*
output=$(NOTMUCH_NEW --debug 2>&1 | sed 's/: .*$//' )
-chmod u+w ${MAIL_DIR}/.notmuch/xapian/*.*
+chmod u+w ${MAIL_DIR}/.notmuch/xapian/*.*
test_expect_equal "$output" "A Xapian exception occurred opening database"
test_expect_code 0 "notmuch show --format=json id:mid-loop-12@example.org id:mid-loop-21@example.org > OUTPUT"
test_begin_subtest "reference loop ordered by date"
-threadid=$(notmuch search --output=threads id:mid-loop-12@example.org)
-notmuch show --format=mbox $threadid | grep '^Date' > OUTPUT
+threadid=$(notmuch search --output=threads id:mid-loop-12@example.org)
+notmuch show --format=mbox $threadid | grep '^Date' > OUTPUT
cat <<EOF > EXPECTED
Date: Thu, 16 Jun 2016 22:14:41 -0400
Date: Fri, 17 Jun 2016 22:14:41 -0400
# DUPLICATE_MESSAGE_ID is not tested here, because it should actually pass.
# pregenerate all of the test shims
-for code in FILE_NOT_EMAIL READ_ONLY_DATABASE UPGRADE_REQUIRED PATH_ERROR OUT_OF_MEMORY XAPIAN_EXCEPTION; do
+for code in FILE_NOT_EMAIL READ_ONLY_DATABASE UPGRADE_REQUIRED PATH_ERROR OUT_OF_MEMORY XAPIAN_EXCEPTION; do
make_shim shim-$code <<EOF
#include <notmuch.h>
#include <stdio.h>
gen_insert_msg
-for code in FILE_NOT_EMAIL READ_ONLY_DATABASE UPGRADE_REQUIRED PATH_ERROR; do
+for code in FILE_NOT_EMAIL READ_ONLY_DATABASE UPGRADE_REQUIRED PATH_ERROR; do
test_begin_subtest "EXIT_FAILURE when index_file returns $code"
test_expect_code 1 "notmuch_with_shim shim-$code insert < \"$gen_msg_filename\""
Subject: No messages excluded: single match: reply 5"
test_begin_subtest "Show, exclude=false"
-output=$(notmuch show --exclude=false tag:test | notmuch_show_sanitize_all | egrep "Subject:|message{")
+output=$(notmuch show --exclude=false tag:test | notmuch_show_sanitize_all | egrep "Subject:|message{")
test_expect_equal "$output" "\fmessage{ id:XXXXX depth:0 match:1 excluded:1 filename:XXXXX
Subject: All messages excluded: single match: reply 2
\fmessage{ id:XXXXX depth:0 match:1 excluded:1 filename:XXXXX
thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Two (inbox tag4 tag5 unread)"
# generate a common input file for the next several tests.
-cat > batch.in <<EOF
+cat > batch.in <<EOF
# %40 is an @ in tag
+%40 -tag5 +tag6 -- One
+tag1 -tag1 -tag4 +tag4 -- Two
test_expect_code 1 'notmuch tag +- One'
test_begin_subtest "Xapian exception: read only files"
-chmod u-w ${MAIL_DIR}/.notmuch/xapian/*.*
+chmod u-w ${MAIL_DIR}/.notmuch/xapian/*.*
output=$(notmuch tag +something '*' 2>&1 | sed 's/: .*$//' )
-chmod u+w ${MAIL_DIR}/.notmuch/xapian/*.*
+chmod u+w ${MAIL_DIR}/.notmuch/xapian/*.*
test_expect_equal "$output" "A Xapian exception occurred opening database"
test_done
notmuch show --format=raw subject:$size > OUTPUT
test_expect_equal_file mail/size-$size OUTPUT
test_begin_subtest "return value, message of size $size"
- test_expect_success "notmuch show --format=raw subject:$size > /dev/null"
+ test_expect_success "notmuch show --format=raw subject:$size > /dev/null"
done
test_done
'[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
'[body]="Multiple recipients"'
-output=$(notmuch reply --reply-to=sender id:${gen_msg_id})
+output=$(notmuch reply --reply-to=sender id:${gen_msg_id})
test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
Subject: Re: notmuch-reply-test
To: Sender <sender@example.com>
'[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
'[body]="From Us, Multiple TO recipients"'
-output=$(notmuch reply --reply-to=sender id:${gen_msg_id})
+output=$(notmuch reply --reply-to=sender id:${gen_msg_id})
test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
Subject: Re: notmuch-reply-test
To: Recipient <recipient@example.com>, Someone Else <someone@example.com>
'[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
'[body]="reply with CC"'
-output=$(notmuch reply --reply-to=sender id:${gen_msg_id})
+output=$(notmuch reply --reply-to=sender id:${gen_msg_id})
test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
Subject: Re: notmuch-reply-test
To: Sender <sender@example.com>
'[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
'[body]="reply with CC"'
-output=$(notmuch reply --reply-to=sender id:${gen_msg_id})
+output=$(notmuch reply --reply-to=sender id:${gen_msg_id})
test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
Subject: Re: notmuch-reply-test
To: Recipient <recipient@example.com>
'[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
'[body]="reply with CC"'
-output=$(notmuch reply --reply-to=sender id:${gen_msg_id})
+output=$(notmuch reply --reply-to=sender id:${gen_msg_id})
test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
Subject: Re: notmuch-reply-test
Cc: Other Parties <cc@example.com>
'[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
'[body]="reply from alternate address"'
-output=$(notmuch reply --reply-to=sender id:${gen_msg_id})
+output=$(notmuch reply --reply-to=sender id:${gen_msg_id})
test_expect_equal "$output" "From: Notmuch Test Suite <test_suite_other@notmuchmail.org>
Subject: Re: notmuch-reply-test
To: Sender <sender@example.com>
'[body]="support for reply-to"' \
'[reply-to]="Sender <elsewhere@example.com>"'
-output=$(notmuch reply --reply-to=sender id:${gen_msg_id})
+output=$(notmuch reply --reply-to=sender id:${gen_msg_id})
test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
Subject: Re: notmuch-reply-test
To: Sender <elsewhere@example.com>
'[body]="support for reply-to with multiple recipients"' \
'[reply-to]="Sender <elsewhere@example.com>"'
-output=$(notmuch reply --reply-to=sender id:${gen_msg_id})
+output=$(notmuch reply --reply-to=sender id:${gen_msg_id})
test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
Subject: Re: notmuch-reply-test
To: Sender <elsewhere@example.com>
'[body]="Un-munging Reply-To"' \
'[reply-to]="Evil Munging List <list@example.com>"'
-output=$(notmuch reply --reply-to=sender id:${gen_msg_id})
+output=$(notmuch reply --reply-to=sender id:${gen_msg_id})
test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
Subject: Re: notmuch-reply-test
To: Sender <sender@example.com>
add_message '[subject]="This subject is exactly 200 bytes in length. Other than its length there is not much of note here. Note that the length of 200 bytes includes the Subject: and Re: prefixes with two spaces"' \
'[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
'[body]="200-byte header"'
-output=$(notmuch reply --reply-to=sender id:${gen_msg_id})
+output=$(notmuch reply --reply-to=sender id:${gen_msg_id})
test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
Subject: Re: This subject is exactly 200 bytes in length. Other than its
length there is not much of note here. Note that the length of 200 bytes
test_expect_success \
'notmuch restore --input=dump.expected &&
notmuch restore --accumulate --input=dump-ABC_DEF.expected &&
- notmuch dump > OUTPUT.$test_count &&
+ notmuch dump > OUTPUT.$test_count &&
notmuch restore --input=dump.expected &&
test_cmp dump-ABC_DEF.expected OUTPUT.$test_count'
test_begin_subtest 'format=batch-tag, checking encoded output'
NOTMUCH_DUMP_TAGS --format=batch-tag -- from:cworth |\
awk "{ print \"+$enc1 +$enc2 +$enc3 -- \" \$5 }" > EXPECTED.$test_count
-NOTMUCH_DUMP_TAGS --format=batch-tag -- from:cworth > OUTPUT.$test_count
+NOTMUCH_DUMP_TAGS --format=batch-tag -- from:cworth > OUTPUT.$test_count
test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count
test_begin_subtest 'restoring sane tags'
test_begin_subtest "Tag changes modify flags of multiple files"
notmuch tag -replied subject:"Duplicated message"
(cd $MAIL_DIR/cur/; ls duplicated*) > actual
-test_expect_equal "$(< actual)" "duplicated-message-another-copy:2,S
+test_expect_equal "$(< actual)" "duplicated-message-another-copy:2,S
duplicated-message-copy:2,S
duplicated-message:2,S"
. $(dirname "$0")/test-lib.sh || exit 1
test_begin_subtest "sanity check"
-$TEST_DIRECTORY/arg-test pos1 --keyword=one --boolean --string=foo pos2 --int=7 --flag=one --flag=three > OUTPUT
+$TEST_DIRECTORY/arg-test pos1 --keyword=one --boolean --string=foo pos2 --int=7 --flag=one --flag=three > OUTPUT
cat <<EOF > EXPECTED
boolean 1
keyword 1
test_begin_subtest "round trip newlines"
printf 'this\n tag\t has\n spaces\n' > EXPECTED.$test_count
-$TEST_DIRECTORY/hex-xcode --direction=encode < EXPECTED.$test_count |\
+$TEST_DIRECTORY/hex-xcode --direction=encode < EXPECTED.$test_count |\
$TEST_DIRECTORY/hex-xcode --direction=decode > OUTPUT.$test_count
test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count
test_begin_subtest "round trip 8bit chars"
echo '%c3%91%c3%a5%c3%b0%c3%a3%c3%a5%c3%a9-%c3%8f%c3%8a' > EXPECTED.$test_count
-$TEST_DIRECTORY/hex-xcode --direction=decode < EXPECTED.$test_count |\
+$TEST_DIRECTORY/hex-xcode --direction=decode < EXPECTED.$test_count |\
$TEST_DIRECTORY/hex-xcode --direction=encode > OUTPUT.$test_count
test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count
test_begin_subtest "round trip newlines (in-place)"
printf 'this\n tag\t has\n spaces\n' > EXPECTED.$test_count
-$TEST_DIRECTORY/hex-xcode --in-place --direction=encode < EXPECTED.$test_count |\
+$TEST_DIRECTORY/hex-xcode --in-place --direction=encode < EXPECTED.$test_count |\
$TEST_DIRECTORY/hex-xcode --in-place --direction=decode > OUTPUT.$test_count
test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count
test_begin_subtest "round trip 8bit chars (in-place)"
echo '%c3%91%c3%a5%c3%b0%c3%a3%c3%a5%c3%a9-%c3%8f%c3%8a' > EXPECTED.$test_count
-$TEST_DIRECTORY/hex-xcode --in-place --direction=decode < EXPECTED.$test_count |\
+$TEST_DIRECTORY/hex-xcode --in-place --direction=decode < EXPECTED.$test_count |\
$TEST_DIRECTORY/hex-xcode --in-place --direction=encode > OUTPUT.$test_count
test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count
add_email_corpus threading
test_begin_subtest "reply to ghost"
-notmuch show --entire-thread=true id:000-real-root@example.org | grep ^Subject: | head -1 > OUTPUT
+notmuch show --entire-thread=true id:000-real-root@example.org | grep ^Subject: | head -1 > OUTPUT
cat <<EOF > EXPECTED
Subject: root message
EOF
notmuch_tags_t *result;
EXPECT0(notmuch_database_close (db));
result = notmuch_database_get_all_tags (db);
- printf("%d\n", result == NULL);
+ printf("%d\n", result == NULL);
stat = NOTMUCH_STATUS_XAPIAN_EXCEPTION;
}
EOF
char *result;
EXPECT0(notmuch_database_close (db));
stat = notmuch_database_get_config (db, "foo", &result);
- printf("%d\n", stat == NOTMUCH_STATUS_SUCCESS);
+ printf("%d\n", stat == NOTMUCH_STATUS_SUCCESS);
}
EOF
cat <<EOF > EXPECTED
{
EXPECT0(notmuch_database_close (db));
stat = notmuch_database_set_config (db, "foo", "bar");
- printf("%d\n", stat == NOTMUCH_STATUS_XAPIAN_EXCEPTION);
+ printf("%d\n", stat == NOTMUCH_STATUS_XAPIAN_EXCEPTION);
}
EOF
cat <<EOF > EXPECTED
EXPECT0(notmuch_database_close (db));
notmuch_decryption_policy_t policy = notmuch_indexopts_get_decrypt_policy (result);
stat = notmuch_indexopts_set_decrypt_policy (result, policy);
- printf("%d\n%d\n", policy == NOTMUCH_DECRYPT_AUTO, stat == NOTMUCH_STATUS_SUCCESS);
+ printf("%d\n%d\n", policy == NOTMUCH_DECRYPT_AUTO, stat == NOTMUCH_STATUS_SUCCESS);
}
EOF
cat <<EOF > EXPECTED
notmuch_status_t status;
notmuch_bool_t out;
status = notmuch_message_has_maildir_flag_st (message, 'S', &out);
- printf("%d\n%d\n", message != NULL, status == NOTMUCH_STATUS_XAPIAN_EXCEPTION);
+ printf("%d\n%d\n", message != NULL, status == NOTMUCH_STATUS_XAPIAN_EXCEPTION);
}
EOF
cat <<EOF > EXPECTED
{
notmuch_status_t status;
status = notmuch_message_maildir_flags_to_tags (message);
- printf("%d\n%d\n", message != NULL, status == NOTMUCH_STATUS_XAPIAN_EXCEPTION);
+ printf("%d\n%d\n", message != NULL, status == NOTMUCH_STATUS_XAPIAN_EXCEPTION);
}
EOF
cat <<EOF > EXPECTED
{
notmuch_status_t status;
status = notmuch_message_remove_all_tags (message);
- printf("%d\n%d\n", message != NULL, status == NOTMUCH_STATUS_XAPIAN_EXCEPTION);
+ printf("%d\n%d\n", message != NULL, status == NOTMUCH_STATUS_XAPIAN_EXCEPTION);
}
EOF
cat <<EOF > EXPECTED
{
notmuch_status_t status;
status = notmuch_message_freeze (message);
- printf("%d\n%d\n", message != NULL, status == NOTMUCH_STATUS_SUCCESS);
+ printf("%d\n%d\n", message != NULL, status == NOTMUCH_STATUS_SUCCESS);
}
EOF
cat <<EOF > EXPECTED
{
notmuch_status_t status;
status = notmuch_message_thaw (message);
- printf("%d\n%d\n", message != NULL, status == NOTMUCH_STATUS_UNBALANCED_FREEZE_THAW);
+ printf("%d\n%d\n", message != NULL, status == NOTMUCH_STATUS_UNBALANCED_FREEZE_THAW);
}
EOF
cat <<EOF > EXPECTED
cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR}
{
notmuch_message_destroy (message);
- printf("%d\n%d\n", message != NULL, 1);
+ printf("%d\n%d\n", message != NULL, 1);
}
EOF
cat <<EOF > EXPECTED
{
notmuch_database_t *db2;
db2 = notmuch_message_get_database (message);
- printf("%d\n%d\n", message != NULL, db == db2);
+ printf("%d\n%d\n", message != NULL, db == db2);
}
EOF
cat <<EOF > EXPECTED
{
notmuch_status_t status;
status = notmuch_message_reindex (message, NULL);
- printf("%d\n%d\n", message != NULL, status == NOTMUCH_STATUS_XAPIAN_EXCEPTION);
+ printf("%d\n%d\n", message != NULL, status == NOTMUCH_STATUS_XAPIAN_EXCEPTION);
}
EOF
cat <<EOF > EXPECTED
test_expect_equal_file initial-dump OUTPUT
test_begin_subtest 'reindex preserves tags with special prefixes'
-notmuch tag +attachment2 +encrypted2 +signed2 '*'
+notmuch tag +attachment2 +encrypted2 +signed2 '*'
notmuch dump > EXPECTED
notmuch reindex '*'
notmuch dump > OUTPUT
-notmuch tag -attachment2 -encrypted2 -signed2 '*'
+notmuch tag -attachment2 -encrypted2 -signed2 '*'
test_expect_equal_file EXPECTED OUTPUT
test_begin_subtest 'reindex moves a message between threads'
add_email_corpus lkml
test_begin_subtest "new doesn't run out of file descriptors with many gzipped files"
ulimit -n 200
-find ${MAIL_DIR} -name .notmuch -prune -o -type f -print0 | xargs -0 gzip --
+find ${MAIL_DIR} -name .notmuch -prune -o -type f -print0 | xargs -0 gzip --
test_expect_success "notmuch new"
test_done