unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
blob ee3126c07e594aace149d43ffe46d21f102600dd 2133 bytes (raw)
name: test/config 	 # 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
 
#!/usr/bin/env bash
test_description='notmuch config'
. ./test-lib.sh


config_options=(
    "database.path"
    "user.name"
    "user.primary_email"
    "user.other_email"
    "new.tags"
    "maildir.synchronize_flags"
)


test_begin_subtest 'getting config: "config get <section>.<item>"'
echo -n "" > OUTPUT
for i in ${config_options[*]} ; do
    notmuch config get "${i}"
done >> OUTPUT
cat >EXPECTED <<EOF
${MAIL_DIR}
Notmuch Test Suite
test_suite@notmuchmail.org
test_suite_other@notmuchmail.org
test_suite@otherdomain.org
unread
inbox
true
EOF
test_expect_equal_file OUTPUT EXPECTED


test_begin_subtest 'setting config: "config set <section>.<item> [values ...]"'
notmuch config set database.path /path/to/maildir
notmuch config set user.name "User Name"
notmuch config set user.primary_email primary_email@notmuchmail.org
notmuch config set user.other_email alt1@notmuchmail.org alt2@notmuchmail.org
notmuch config set new.tags tag1 tag2 tag3
notmuch config set maildir.synchronize_flags false
echo -n "" > OUTPUT
for i in ${config_options[*]} ; do
    notmuch config get "${i}"
done >> OUTPUT
cat >EXPECTED <<EOF
/path/to/maildir
User Name
primary_email@notmuchmail.org
alt1@notmuchmail.org
alt2@notmuchmail.org
tag1
tag2
tag3
false
EOF
test_expect_equal_file OUTPUT EXPECTED


test_begin_subtest 'removing config: "config set <section>.<item>"'
notmuch config set database.path
notmuch config set user.name
notmuch config set user.primary_email
notmuch config set user.other_email
notmuch config set new.tags
notmuch config set maildir.synchronize_flags
echo -n "" > OUTPUT
for i in ${config_options[*]} ; do
    notmuch config get "${i}"
done >> OUTPUT

# FIXME: Not the most robust nor portable solution here...
# Especially `hostname --domain' may have unwanted effects on
# some platforms, e.g. setting your hostname to "--domain" ;)
fallback_name="$(grep $(id -un) /etc/passwd | cut -d ":" -f 5 | cut -d "," -f 1)"
fallback_email="$(id -un)@$(hostname).$(hostname --domain)"

cat >EXPECTED <<EOF
${HOME}/mail
${fallback_name}
${fallback_email}
unread
inbox
true
EOF
test_expect_equal_file OUTPUT EXPECTED


test_done

debug log:

solving ee3126c ...
found ee3126c in https://yhetil.org/notmuch/1326389401-20468-1-git-send-email-pieter@praet.org/ ||
	https://yhetil.org/notmuch/1326531476-14556-1-git-send-email-pieter@praet.org/

applying [1/1] https://yhetil.org/notmuch/1326389401-20468-1-git-send-email-pieter@praet.org/
diff --git a/test/config b/test/config
new file mode 100755
index 0000000..ee3126c

Checking patch test/config...
Applied patch test/config cleanly.

skipping https://yhetil.org/notmuch/1326531476-14556-1-git-send-email-pieter@praet.org/ for ee3126c
index at:
100755 ee3126c07e594aace149d43ffe46d21f102600dd	test/config

(*) 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).