database.path=MAIL_DIR
foo.list=this;is another;list value;
foo.string=this is another string value
+index.as_text=
maildir.synchronize_flags=true
new.ignore=
new.tags=unread;inbox
EOF
test_expect_equal_file EXPECTED OUTPUT
+test_begin_subtest "Round trip config item with leading spaces"
+test_subtest_known_broken
+notmuch config set foo.bar " thing"
+output=$(notmuch config get foo.bar)
+test_expect_equal "${output}" " thing"
+
+test_begin_subtest "Round trip config item with leading tab"
+test_subtest_known_broken
+notmuch config set foo.bar " thing"
+output=$(notmuch config get foo.bar)
+test_expect_equal "${output}" " thing"
+
+test_begin_subtest "Round trip config item with embedded tab"
+notmuch config set foo.bar "thing other"
+output=$(notmuch config get foo.bar)
+test_expect_equal "${output}" "thing other"
+
+test_begin_subtest "Round trip config item with embedded backslash"
+notmuch config set foo.bar 'thing\other'
+output=$(notmuch config get foo.bar)
+test_expect_equal "${output}" "thing\other"
+
+test_begin_subtest "Round trip config item with embedded NL/CR"
+notmuch config set foo.bar 'thing
+\rother'
+output=$(notmuch config get foo.bar)
+test_expect_equal "${output}" "thing
+\rother"
+
test_begin_subtest "Top level --config=FILE option"
cp "${NOTMUCH_CONFIG}" alt-config
notmuch --config=alt-config config set user.name "Another Name"