aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorGravatar Jani Nikula <jani@nikula.org>2013-04-07 20:15:02 +0300
committerGravatar David Bremner <bremner@debian.org>2013-04-14 18:35:02 -0300
commit7defbcdcec8bd89723dcd3548d2bfc7d58f0275d (patch)
treeb4abfc268b177899371f93c1e7f9d760e18dc4a8 /test
parent661dcf87aeb7062465786e3221fb0cb4837b05f1 (diff)
test: add some config file tests
Test the --config=FILE option, and add a broken test for writing config file through a symbolic link.
Diffstat (limited to 'test')
-rwxr-xr-xtest/config24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/config b/test/config
index cfa1f327..344eced3 100755
--- a/test/config
+++ b/test/config
@@ -57,4 +57,28 @@ maildir.synchronize_flags=true
foo.string=this is another string value
foo.list=this;is another;list value;"
+test_begin_subtest "Top level --config=FILE option"
+cp "${NOTMUCH_CONFIG}" alt-config
+notmuch --config=alt-config config set user.name "Another 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_expect_equal "$(notmuch config get user.name)" \
+ "Notmuch Test Suite"
+
+test_begin_subtest "Read config file through a symlink"
+ln -s alt-config alt-config-link
+test_expect_equal "$(notmuch --config=alt-config-link config get user.name)" \
+ "Another Name"
+
+test_begin_subtest "Write config file through a symlink"
+notmuch --config=alt-config-link config set user.name "Link Name"
+test_expect_equal "$(notmuch --config=alt-config-link config get user.name)" \
+ "Link Name"
+
+test_begin_subtest "Writing config file through symlink follows symlink"
+test_subtest_known_broken
+test_expect_equal "$(readlink alt-config-link)" "alt-config"
+
test_done