From: Eric Wong <e@80x24.org>
Date: Tue, 1 Feb 2022 23:34:28 +0000 (+0000)
Subject: test_lei: use consistent locale for error messages
X-Git-Tag: v1.8.0~31
X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=303c3507b4aefc0e08d792de02357ea9ab0fc322;p=public-inbox.git

test_lei: use consistent locale for error messages

git-config(1) error messages are locale-dependent, so follow
the lead taken by git's own test suite and set LC_ALL=C and LANG=C
to ensure error messages we check against are not localized.

Reported-by: Julien Moutinho <julm+public-inbox@sourcephile.fr>
---

diff --git a/lib/PublicInbox/TestCommon.pm b/lib/PublicInbox/TestCommon.pm
index 052d6e45..ca732811 100644
--- a/lib/PublicInbox/TestCommon.pm
+++ b/lib/PublicInbox/TestCommon.pm
@@ -568,6 +568,7 @@ SKIP: {
 	delete $ENV{XDG_CACHE_HOME};
 	$ENV{GIT_COMMITTER_EMAIL} = 'lei@example.com';
 	$ENV{GIT_COMMITTER_NAME} = 'lei user';
+	$ENV{LANG} = $ENV{LC_ALL} = 'C';
 	my (undef, $fn, $lineno) = caller(0);
 	my $t = "$fn:$lineno";
 	state $lei_daemon = PublicInbox::Spawn->can('send_cmd4') ||