develooper Front page | perl.perl5.porters | Postings from December 2001

[PATCH Langinfo.t] better silent errors

Thread Next
From:
Rafael Garcia-Suarez
Date:
December 29, 2001 09:36
Subject:
[PATCH Langinfo.t] better silent errors
Message ID:
20011229183802.A28175@rafael
I keep having the error 'your vendor has not defined some macro' on my
Redhat 7.0 while executing the test for I18N::Langinfo.

The patch below silents this error and makes the test succeed.
(however I don't know why the import() works, but the langinfo()
dies. Is this a problem with I18N::Langinfo?)

--- ext/I18N/Langinfo/Langinfo.t.orig	Wed Dec  5 21:59:07 2001
+++ ext/I18N/Langinfo/Langinfo.t	Sat Dec 29 18:20:01 2001
@@ -38,9 +38,12 @@
     
 for my $i (1..@want) {
     my $try = $want[$i-1];
-    eval { I18N::Langinfo->import($try) };
+    my $got;
+    eval {
+	I18N::Langinfo->import($try);
+	$got = langinfo(&$try);
+    };
     unless ($@) {
-	my $got = langinfo(&$try);
 	if (ref $want{$try} && $got =~ $want{$try} || $got eq $want{$try}) {
 	    print qq[ok $i - $try is "$got"\n];
 	} else {

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About