Thread (44 messages) flat view 44 messages, 5 authors, 2016-06-15
STALE3734d REVIEWED: 1 (0M)

1 review trailer.

[PATCH/RFC 08/17] gettext tests: test if $VERSION exists before using it

From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2016-06-15 22:49:24
Subsystem: the rest · Maintainer: Linus Torvalds

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 <redacted>
Tested-by: Jens Lehmann <redacted>
Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
---
 t/t0202/test.pl |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/t/t0202/test.pl b/t/t0202/test.pl
index c2055fa..6b00603 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'}");
 
-- 
1.7.2.2.536.g3f548
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help