]> git.notmuchmail.org Git - notmuch/commitdiff
test: add some config file tests
authorJani Nikula <jani@nikula.org>
Sun, 7 Apr 2013 17:15:02 +0000 (20:15 +0300)
committerDavid Bremner <bremner@debian.org>
Sun, 14 Apr 2013 21:35:02 +0000 (18:35 -0300)
Test the --config=FILE option, and add a broken test for writing
config file through a symbolic link.

test/config

index cfa1f327b94c4d1e96481afcd15d2f4692353f86..344eced36c9781b7d26a4006a7f4efb5a9be4d1b 100755 (executable)
@@ -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