texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]


From: Patrice Dumas
Date: Wed, 28 Sep 2022 18:34:24 -0400 (EDT)

branch: master
commit 0ff345ada5509c319112afc6312b364e359c58c4
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Wed Sep 28 22:48:24 2022 +0200

    tp/t/test_utils.pl: initialize instead of relying on autovivification
---
 tp/t/results/indices/double_seeentry_seealso.pl  |  3 +++
 tp/t/results/indices/empty_string_index_entry.pl |  3 +++
 tp/t/results/indices/seeentry.pl                 |  3 +++
 tp/t/test_utils.pl                               | 15 +++++++++++----
 4 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/tp/t/results/indices/double_seeentry_seealso.pl 
b/tp/t/results/indices/double_seeentry_seealso.pl
index ae8e9fd3be..efbeb9e4ed 100644
--- a/tp/t/results/indices/double_seeentry_seealso.pl
+++ b/tp/t/results/indices/double_seeentry_seealso.pl
@@ -820,6 +820,9 @@ $result_errors{'double_seeentry_seealso'} = [];
 $result_floats{'double_seeentry_seealso'} = {};
 
 
+$result_indices_sort_strings{'double_seeentry_seealso'} = {};
+
+
 
 $result_converted{'docbook'}->{'double_seeentry_seealso'} = '<chapter 
label="1" id="node-index">
 <title>Chapter Index</title>
diff --git a/tp/t/results/indices/empty_string_index_entry.pl 
b/tp/t/results/indices/empty_string_index_entry.pl
index 4fff55533e..4322103efc 100644
--- a/tp/t/results/indices/empty_string_index_entry.pl
+++ b/tp/t/results/indices/empty_string_index_entry.pl
@@ -849,6 +849,9 @@ $result_errors{'empty_string_index_entry'} = [
 $result_floats{'empty_string_index_entry'} = {};
 
 
+$result_indices_sort_strings{'empty_string_index_entry'} = {};
+
+
 
 $result_converted{'info'}->{'empty_string_index_entry'} = 'This is , produced 
from .
 
diff --git a/tp/t/results/indices/seeentry.pl b/tp/t/results/indices/seeentry.pl
index f5ba2d18c1..4104969e3c 100644
--- a/tp/t/results/indices/seeentry.pl
+++ b/tp/t/results/indices/seeentry.pl
@@ -707,6 +707,9 @@ $result_errors{'seeentry'} = [];
 $result_floats{'seeentry'} = {};
 
 
+$result_indices_sort_strings{'seeentry'} = {};
+
+
 
 $result_converted{'docbook'}->{'seeentry'} = '<chapter label="1" 
id="chapter-index">
 <title>Index</title>
diff --git a/tp/t/test_utils.pl b/tp/t/test_utils.pl
index 5aba74058a..628656ee69 100644
--- a/tp/t/test_utils.pl
+++ b/tp/t/test_utils.pl
@@ -19,6 +19,8 @@
 
 use strict;
 
+#no autovivification qw(fetch delete exists store strict);
+
 use 5.006;
 
 BEGIN {
@@ -828,6 +830,7 @@ sub test($$)
   $test_text = shift @$test_case;
   $parser_options = shift @$test_case if (@$test_case);
   $converter_options = shift @$test_case if (@$test_case);
+  $converter_options = {} if (! defined($converter_options));
 
   if (!$self->{'generate'}) {
     mkdir "t/results/$self->{'name'}" if (! -d "t/results/$self->{'name'}");
@@ -1121,7 +1124,7 @@ sub test($$)
   # indices
   my $indices;
   my $trimmed_index_names = remove_keys($index_names, ['index_entries']);
-  $indices->{'index_names'} = $trimmed_index_names
+  $indices = {'index_names' => $trimmed_index_names}
     unless (Data::Compare::Compare($trimmed_index_names, 
$initial_index_names));
 
   my ($sorted_index_entries, $index_entries_sort_strings);
@@ -1131,6 +1134,7 @@ sub test($$)
       = Texinfo::Structuring::sort_indices($registrar,
                                    $main_configuration,
                                    $merged_index_entries);
+    $indices_sorted_sort_strings = {};
     foreach my $index_name (keys(%$sorted_index_entries)) {
       # index entries sort strings sorted in the order of the index entries
       if (scalar(@{$sorted_index_entries->{$index_name}})) {
@@ -1542,9 +1546,12 @@ sub test($$)
         }
         if ($reference_exists) {
           $tests_count += 1;
-          ok (Data::Compare::Compare($converted_errors{$format},
-               $result_converted_errors{$format}->{$test_name}),
-               $test_name.' errors '.$format);
+          ok (((not defined($converted_errors{$format})
+               and (not $result_converted_errors{$format}
+                    or not $result_converted_errors{$format}->{$test_name}))
+               or Data::Compare::Compare($converted_errors{$format},
+                              
$result_converted_errors{$format}->{$test_name})),
+              $test_name.' errors '.$format);
         }
       }
     }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]