diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-04-12 11:23:23 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-04-12 11:23:23 -0700 |
commit | cabdee2c5ed55aa42784b37c1249829fca9d71b8 (patch) | |
tree | 9f7463177d927e53c289bf51d635bfd569ab700e /t/test-lib.sh | |
parent | 2c050e017a5e7727a7448620d872d46ba22675e9 (diff) | |
download | git-cabdee2c5ed55aa42784b37c1249829fca9d71b8.tar.gz |
i18n: do not overuse C_LOCALE_OUTPUT
It is too coarse-grained way that led to artificial splitting of a
logically single test case into "do" and "check only without poison".
As the majority of check is done by comparing expected and actual output
stored in a file with test_cmp anyway, just introduce test_i18ncmp that
pretends the actual output matched the expected one when gettext-poison
is in effect.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/test-lib.sh')
-rw-r--r-- | t/test-lib.sh | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/t/test-lib.sh b/t/test-lib.sh index abc47f3abc..3e7c2bb726 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -1077,6 +1077,14 @@ else test_set_prereq C_LOCALE_OUTPUT fi +# Use this instead of test_cmp to compare files that contain expected and +# actual output from git commands that can be translated. When running +# under GETTEXT_POISON this pretends that the command produced expected +# results. +test_i18ncmp () { + test -n "$GETTEXT_POISON" || test_cmp "$@" +} + # test whether the filesystem supports symbolic links ln -s x y 2>/dev/null && test -h y 2>/dev/null && test_set_prereq SYMLINKS rm -f y |