From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 6PMxBucBVmFl6gAAgWs5BA (envelope-from ) for ; Thu, 30 Sep 2021 20:28:55 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id YATHAecBVmH0BwAAbx9fmQ (envelope-from ) for ; Thu, 30 Sep 2021 18:28:55 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [144.217.243.247]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 79D5427AB2 for ; Thu, 30 Sep 2021 20:28:54 +0200 (CEST) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 17A8826D8C; Thu, 30 Sep 2021 14:28:47 -0400 (EDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by mail.notmuchmail.org (Postfix) with ESMTP id 1568020364 for ; Thu, 30 Sep 2021 14:28:42 -0400 (EDT) Received: by fethera.tethera.net (Postfix, from userid 1001) id DFAFB5FD5C; Thu, 30 Sep 2021 14:28:41 -0400 (EDT) Received: (nullmailer pid 4125036 invoked by uid 1000); Thu, 30 Sep 2021 18:28:40 -0000 From: David Bremner To: David Bremner , notmuch@notmuchmail.org, Ciprian Dorin Craciun Subject: [PATCH 1/2] test: known broken tests for escape characters in config files. Date: Thu, 30 Sep 2021 15:28:34 -0300 Message-Id: <20210930182835.4125022-1-david@tethera.net> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210930171748.4044617-2-david@tethera.net> References: <20210930171748.4044617-2-david@tethera.net> MIME-Version: 1.0 Message-ID-Hash: IQBG36YELADA7RT5VTLU3F6OXUNFWYAM X-Message-ID-Hash: IQBG36YELADA7RT5VTLU3F6OXUNFWYAM X-MailFrom: bremner@tethera.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.1 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1633026534; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=eiS6hur4mXvuc9TvdGTmN6Ji5ySiXTrI6kVECDUXv9E=; b=Wj+bn7ORODenVPCOYGgt/rhbsu/EFlI8ltD06iihRqDy1ImEqRBB6GKUltgmKe2DAFU0+N jXRSXlwGWs1n7Hn/IqiX8/FhDUpXwYgw0a2ZFfyEnouM3jb/PUYdPOaGL0YJw6kmL35aXt DxKcamkMOLYDVwZBBDISjBGfnw0hAZnjwrcJAgZJGmvOJfKHRuU1xFvY3gR6TD4ZC70hXb uzY8uBSExHEiYQxe4a/qwWVVv2ovlTAASx8VNDGbqwSQxevA+wjA9watRmcy4oK0mHHneI +tme11uWxHD34VhlT+S344M43J25IMjjx3LeLgozuDr7YISVHqtgnqoJMP7wGw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1633026534; a=rsa-sha256; cv=none; b=jDeQsBBRJgGHe5IzGvwEu8mElb/DCYaQJH2aTfUfCUwRJhz85fqxEujef5o3uzXOL6DuTO ify3FdpNiXF0D6aeXktl0rAiiHCIVEHeaq3Tm5sgfxhjtUNBrbqiLFhfwij/C64iw5ICJJ NguoyPp/ZoIvTQ6kgg0oboTpoUdvrAB8tt5ZxTeLdypExFnNmumiSY166jJ3tHSpXe/g56 UmKaXYsMvoNpiXzoX/QGSeMyzjPgkwFAH95rcY1+lpPWrmTKgh18F4NxpsbfBVzoLyDhaB fUPH3ikUCggxPu3oZdVZqiK8xtyjjKxeFi2JDjLkNdeYfWy/lyhlh4KoMSszAA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 144.217.243.247 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -1.20 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 144.217.243.247 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 79D5427AB2 X-Spam-Score: -1.20 X-Migadu-Scanner: scn0.migadu.com X-TUID: Tfk8He/MYaKI 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. --- test/T030-config.sh | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/test/T030-config.sh b/test/T030-config.sh index 3a585d1b..09dacda3 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" -- 2.33.0