This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
APItest/t/locale.t: Store hash return for readability
authorKarl Williamson <khw@cpan.org>
Wed, 7 Mar 2018 19:08:01 +0000 (12:08 -0700)
committerKarl Williamson <khw@cpan.org>
Mon, 12 Mar 2018 16:17:14 +0000 (10:17 -0600)
ext/XS-APItest/t/locale.t

index 0aae384..441b90f 100644 (file)
@@ -129,13 +129,13 @@ SKIP: {
 
     foreach my $formal_item (sort keys %items) {
         if (exists $correct_C_responses{$formal_item}) {
 
     foreach my $formal_item (sort keys %items) {
         if (exists $correct_C_responses{$formal_item}) {
+            my $correct = $correct_C_responses{$formal_item};
             my $item = eval $items{$formal_item};
             skip "This platform apparently doesn't support $formal_item", 1 if $@;
             my $result = test_Perl_langinfo($item);
             my $item = eval $items{$formal_item};
             skip "This platform apparently doesn't support $formal_item", 1 if $@;
             my $result = test_Perl_langinfo($item);
-            if (defined $correct_C_responses{$formal_item}) {
-                is ($result,
-                    $correct_C_responses{$formal_item},
-                    "Returns expected value ('$result') for $formal_item");
+            if (defined $correct) {
+                is ($result, $correct,
+                    "Returns expected value" . "('$correct') for $formal_item");
             }
             else {
                 ok (defined $result,
             }
             else {
                 ok (defined $result,