diff options
| author | David Bremner <david@tethera.net> | 2021-09-30 15:28:34 -0300 |
|---|---|---|
| committer | David Bremner <david@tethera.net> | 2021-12-04 12:16:47 -0400 |
| commit | 482bd3a46de34c5f6c5cae3696fd56ffdadc6299 (patch) | |
| tree | 24629cbf99adfc8e0d1c94bebc21bfdd162c8ecd /test | |
| parent | bab633d3ac87167dc214094f9d340655885a01b1 (diff) | |
test: known broken tests for escape characters in config files.
glib generates the following escape characters with their usual
meanings: \n, \t, \r, and \\, along with \s for _leading_
spaces. Currently notmuch fails to unescape these on reading the
config files. These tests demonstrate this bug; the one new test that
passes is because apparently glib only escapes tabs at the beginning
of a key.
Diffstat (limited to 'test')
| -rwxr-xr-x | test/T030-config.sh | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/test/T030-config.sh b/test/T030-config.sh index b99eb9e7..1fdde9fe 100755 --- a/test/T030-config.sh +++ b/test/T030-config.sh @@ -67,6 +67,37 @@ user.primary_email=test_suite@notmuchmail.org 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" +test_subtest_known_broken +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" +test_subtest_known_broken +notmuch config set foo.bar 'thing +
other' +output=$(notmuch config get foo.bar) +test_expect_equal "${output}" "thing +
other" + test_begin_subtest "Top level --config=FILE option" cp "${NOTMUCH_CONFIG}" alt-config notmuch --config=alt-config config set user.name "Another Name" |
