From 0a31d166d1f52f1dc744d1441049eb1433a98a5f Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Mon, 30 Aug 2010 19:35:24 +0000 Subject: [PATCH] gettext tests: test if $VERSION exists before using it MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Versions of Locale::Messages before 1.17 didn't have a $VERSION variable. This caused test failures on boxes that had this old version installed, since the warnings pragma emits warnings on STDERR, which fails the test. Change the test to work around this by first checking if the $VERSION variable is defined before using it. Reported-by: Jens Lehmann Tested-by: Jens Lehmann Signed-off-by: Ævar Arnfjörð Bjarmason --- t/t0202/test.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/t/t0202/test.pl b/t/t0202/test.pl index c2055fa8d..6b0060393 100644 --- a/t/t0202/test.pl +++ b/t/t0202/test.pl @@ -11,7 +11,9 @@ my $has_gettext_library = $Git::I18N::__HAS_LIBRARY; ok(1, "Testing Git::I18N version $Git::I18N::VERSION with " . ($has_gettext_library - ? "Locale::Messages version $Locale::Messages::VERSION" + ? (defined $Locale::Messages::VERSION + ? "Locale::Messages version $Locale::Messages::VERSION" + : "Locale::Messages version <1.17") : "NO Perl gettext library")); ok(1, "Git::I18N is located at $INC{'Git/I18N.pm'}"); -- 2.30.2