Julien Moutinho <[email protected]> wrote:
> Which is an artifact of my testing method, because with an absolute perl:
> $ (cd public-inbox-1.7.0; $(which perl) -I$out/lib/perl5/site_perl
> t/lei-q-save.t )
> > [...]
> > not ok 95 - git config parse error shown w/ lei ls-search
> > # Failed test 'git config parse error shown w/ lei ls-search'
> > # at t/lei-q-save.t line 228.
> > # 'fatal: ligne 3 de config incorrecte dans le fichier
> > /tmp/nix-shell.EKTZrS/pi-lei-q-save-3132353-xECZ/lei-daemon/.local/share/lei/saved-searches/after-c8d60f185616bece7957076be4604781d6cae876642a4faa127a2fcfc9647fc8/lei.saved-search
> > # git config -z -l --includes
> > --file=/tmp/nix-shell.EKTZrS/pi-lei-q-save-3132353-xECZ/lei-daemon/.cache/lei/saved-tmp.3132468.1639007508.config
> > failed: $?=32768
> > # '
> > # doesn't match '(?^:bad config
> > line.*?\/tmp\/nix\-shell\.EKTZrS\/pi\-lei\-q\-save\-3132353\-xECZ\/lei\-daemon\/\.local\/share\/lei\/saved\-searches\/after\-c8d60f185616bece7957076be4604781d6cae876642a4faa127a2fcfc9647fc8\/lei\.saved\-search)'
> > ok 96 - lei up --all (up works with bad config)
> > not ok 97 - git config parse error shown w/ lei up
> > # Failed test 'git config parse error shown w/ lei up'
> > # at t/lei-q-save.t line 231.
> > # 'fatal: ligne 3 de config incorrecte dans le fichier
> > /tmp/nix-shell.EKTZrS/pi-lei-q-save-3132353-xECZ/lei-daemon/.local/share/lei/saved-searches/after-c8d60f185616bece7957076be4604781d6cae876642a4faa127a2fcfc9647fc8/lei.saved-search
> > # git config -z -l --includes
> > --file=/tmp/nix-shell.EKTZrS/pi-lei-q-save-3132353-xECZ/lei-daemon/.cache/lei/saved-tmp.3132468.1639007508.config
> > failed: $?=32768
> > # '
> > # doesn't match '(?^:bad config
> > line.*?\/tmp\/nix\-shell\.EKTZrS\/pi\-lei\-q\-save\-3132353\-xECZ\/lei\-daemon\/\.local\/share\/lei\/saved\-searches\/after\-c8d60f185616bece7957076be4604781d6cae876642a4faa127a2fcfc9647fc8\/lei\.saved\-search)'
> It succeeds if I use LANG=C instead of LANG=fr_FR.UTF-8
---------8<---------
Subject: [PATCH] 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.
---
lib/PublicInbox/TestCommon.pm | 1 +
1 file changed, 1 insertion(+)
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} = '[email protected]';
$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') ||
--
unsubscribe: one-click, see List-Unsubscribe header
archive: https://public-inbox.org/meta/