[PATCH 3/4] test: add known broken subtest for the bad config error message

Subject: [PATCH 3/4] test: add known broken subtest for the bad config error message

Date: Fri, 15 Sep 2023 09:50:03 -0300

To: notmuch@notmuchmail.org

Cc:

From: David Bremner


This is a bit fragile w.r.t. glib changing their error message, but it
already helped me find one formatting bug, so for now I think it's
worth it, instead of just grepping for "UTF-8".
---
 test/T030-config.sh | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/test/T030-config.sh b/test/T030-config.sh
index 8b3ef436..11428e8a 100755
--- a/test/T030-config.sh
+++ b/test/T030-config.sh
@@ -200,5 +200,14 @@ 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"
+test_subtest_known_broken
+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
 
-- 
2.40.1

_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: