aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2023-11-01 07:09:38 -0300
committerDavid Bremner <david@tethera.net>2023-11-01 07:09:38 -0300
commit75560c052b98e56783ebecd6444a36ea7fd483c4 (patch)
tree7a6875422727399169c4179d0ee8b801031da9fc /test
parent6f07b14031017fbd2f14adbe7a7f69c6aa954f4b (diff)
parent356ad392716d2a775e58d766c1fec9047cc84163 (diff)
Merge tag 'debian/0.38.1-1' into debian/bookworm-backports
notmuch release 0.38.1-1 for unstable (sid) [dgit] [dgit distro=debian no-split --quilt=linear]
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