1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-10-23 00:58:50 +02:00

ArcanistBundleTestCase: fix support of non-English environments

Summary:
Recently this unit test was always failing for some specific users.
I was able to reproduce the issue with an Italian unix environment:

    arc unit src/parser/__tests__/ArcanistBundleTestCase.php

Obtaining:

    counterexample
    EXCEPTION (Exception): Diff Parse Exception: Expected '\ No newline at end of file'.

After this change, the involved unit test always work also in my Italian environment.

Note that the `LC_ALL=C` means that all localization should be deactivated,
and we should instead use C-sourced strings (not translated in any language). Nice!

Closes T15927

Test Plan: Run the unit test. It does not fail anymore if you are Italian of French or whatever.

Reviewers: O1 Blessed Committers, mainframe98, 20after4

Reviewed By: O1 Blessed Committers, mainframe98, 20after4

Subscribers: mainframe98, aklapper, tobiaswiese, Matthew, Cigaryno

Maniphest Tasks: T15927

Differential Revision: https://we.phorge.it/D25809
This commit is contained in:
Valerio Bozzolan 2024-10-21 07:33:33 +02:00
parent 285e31f4c7
commit b3d45c7104

View file

@ -11,8 +11,10 @@ final class ArcanistBundleTestCase extends PhutilTestCase {
}
private function loadDiff($old, $new) {
// This unit test must parse 'diff' output in a language independent way,
// so we need LC_ALL=C.
list($err, $stdout) = exec_manual(
'diff --unified=65535 --label %s --label %s -- %s %s',
'LC_ALL=C diff --unified=65535 --label %s --label %s -- %s %s',
'file 9999-99-99',
'file 9999-99-99',
$this->getResourcePath($old),