unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: David Bremner <david@tethera.net>
To: notmuch@notmuchmail.org
Subject: [PATCH 1/4] test: add known broken test for bad utf8 in config
Date: Fri, 15 Sep 2023 09:50:01 -0300	[thread overview]
Message-ID: <20230915125004.4129-2-david@tethera.net> (raw)
In-Reply-To: <20230915125004.4129-1-david@tethera.net>

We should ideally print an informative error message, but at the very
least we should not exit with success.
---
 test/T030-config.sh | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/test/T030-config.sh b/test/T030-config.sh
index ea0b4012..6ef759a4 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,11 @@ 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"
+test_subtest_known_broken
+cp initial-config bad-config
+printf '[query]\nq3=from:\xff\n' >>bad-config
+test_expect_code 1 "notmuch --config=./bad-config config list"
+
 test_done
+
-- 
2.40.1

  reply	other threads:[~2023-09-15 12:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-15 12:50 Report GLib errors David Bremner
2023-09-15 12:50 ` David Bremner [this message]
2023-09-15 12:50 ` [PATCH 2/4] CLI: exit with error when load_config returns an error David Bremner
2023-09-15 12:50 ` [PATCH 3/4] test: add known broken subtest for the bad config error message David Bremner
2023-09-15 12:50 ` [PATCH 4/4] Pass error message from GLib ini parser to CLI David Bremner
2023-09-23 11:47 ` Report GLib errors David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230915125004.4129-2-david@tethera.net \
    --to=david@tethera.net \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).