unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
blob 3514920f8041628c0a4204b5c59ea634cfc489f2 1950 bytes (raw)
name: test/insert 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
 
#!/usr/bin/env bash
test_description='"notmuch insert"'
. ./test-lib.sh

# Create directories and database before inserting.
mkdir -p "$MAIL_DIR"/{cur,new,tmp}
mkdir -p "$MAIL_DIR"/Drafts/{cur,new,tmp}
notmuch new > /dev/null

# We use generate_message to create the temporary message file.
# It happens to be in the mail directory already but that is okay.

test_begin_subtest "Insert message, default"
generate_message \
    "[subject]=\"insert-subject\"" \
    "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" \
    "[body]=\"insert-message\""
notmuch insert < "$gen_msg_filename"
test_expect_equal "`notmuch count subject:insert-subject tag:unread`" "1"

test_begin_subtest "Insert message, add tag"
generate_message \
    "[subject]=\"insert-subject-addtag\"" \
    "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" \
    "[body]=\"insert-message-addtag\""
notmuch insert +custom < "$gen_msg_filename"
test_expect_equal "`notmuch count tag:custom`" "1"

test_begin_subtest "Insert message, add/remove tag"
generate_message \
    "[subject]=\"insert-subject-addrmtag\"" \
    "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" \
    "[body]=\"insert-message-addrmtag\""
notmuch insert -- +custom -unread < "$gen_msg_filename"
test_expect_equal "`notmuch count tag:custom NOT tag:unread`" "1"

test_begin_subtest "Insert message, folder"
generate_message \
    "[subject]=\"insert-subject-draft\"" \
    "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" \
    "[body]=\"insert-message-draft\""
notmuch insert --folder=Drafts < "$gen_msg_filename"
test_expect_equal "`notmuch count folder:Drafts`" "1"

test_begin_subtest "Insert message, folder and tags"
generate_message \
    "[subject]=\"insert-subject-draft\"" \
    "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" \
    "[body]=\"insert-message-draft\""
notmuch insert --folder=Drafts -- +draft -unread < "$gen_msg_filename"
test_expect_equal "`notmuch count folder:Drafts tag:draft NOT tag:unread`" "1"

test_done

debug log:

solving 3514920 ...
found 3514920 in https://yhetil.org/notmuch/1343223767-9812-13-git-send-email-novalazy@gmail.com/

applying [1/1] https://yhetil.org/notmuch/1343223767-9812-13-git-send-email-novalazy@gmail.com/
diff --git a/test/insert b/test/insert
new file mode 100755
index 0000000..3514920

Checking patch test/insert...
Applied patch test/insert cleanly.

index at:
100755 3514920f8041628c0a4204b5c59ea634cfc489f2	test/insert

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).