aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2023-09-23 08:43:44 -0300
committerDavid Bremner <david@tethera.net>2023-09-23 08:43:44 -0300
commitd4e9b9072c44dcc6faf112bf7b984a268ad22696 (patch)
treeeb5f7c7aa4e3c303d2d9da91723a33394d0cce61 /test
parente392daa729330e921229e475d00282c1cf926f5d (diff)
parent1c10d91d8e4a3e5bc76ca4c6b9939f3759e6ef5e (diff)
Merge branch 'release'
Diffstat (limited to 'test')
-rwxr-xr-xtest/T030-config.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/T030-config.sh b/test/T030-config.sh
index ea0b4012..621e0b69 100755
--- a/test/T030-config.sh
+++ b/test/T030-config.sh
@@ -3,6 +3,8 @@
test_description='"notmuch config"'
. $(dirname "$0")/test-lib.sh || exit 1
+cp notmuch-config initial-config
+
test_begin_subtest "Get string value"
test_expect_equal "$(notmuch config get user.name)" "Notmuch Test Suite"
@@ -193,4 +195,17 @@ test_begin_subtest "get built_with.nonexistent prints false"
output=$(notmuch config get built_with.nonexistent)
test_expect_equal "$output" "false"
+test_begin_subtest "Bad utf8 reported as error"
+cp initial-config bad-config
+printf '[query]\nq3=from:\xff\n' >>bad-config
+test_expect_code 1 "notmuch --config=./bad-config config list"
+
+test_begin_subtest "Specific error message about bad utf8"
+notmuch --config=./bad-config config list 2>ERRORS
+cat <<EOF > EXPECTED
+GLib: Key file contains key “q3” with value “from:�” which is not UTF-8
+Error: unable to load config file.
+EOF
+test_expect_equal_file EXPECTED ERRORS
+
test_done