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, 14 Feb 2024 08:22:51 -0500 (EST)

branch: master
commit 74e69d9e81ec4b5f4f3cabbe4982c05e1840dcdd
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Wed Feb 14 14:22:43 2024 +0100

    * tp/t/test_sort.t: call Texinfo::Document::indices_sort_strings
    instead of Texinfo::Indices::setup_index_entries_sort_strings for
    one of the two tests to this interface too.
---
 ChangeLog          |  6 ++++++
 tp/t/test_sort.t   | 23 ++++++++++++-----------
 tp/t/test_utils.pl |  6 +++---
 3 files changed, 21 insertions(+), 14 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 3a4af58ef7..cce9e3bd8f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-02-14  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/t/test_sort.t: call Texinfo::Document::indices_sort_strings
+       instead of Texinfo::Indices::setup_index_entries_sort_strings for
+       one of the two tests to this interface too.
+
 2024-02-14  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/Document.pm (sorted_indices_by_letter)
diff --git a/tp/t/test_sort.t b/tp/t/test_sort.t
index 6b4b575cfe..0cb2cb26c9 100644
--- a/tp/t/test_sort.t
+++ b/tp/t/test_sort.t
@@ -42,19 +42,26 @@ my $document = $parser->parse_texi_text('@node Top
 @cindex aaaaaaaaaaaa
 @cindex @l{}
 ');
-$tree = $document->tree();
 
 my $registrar = $parser->registered_errors();
+my $main_configuration = Texinfo::MainConfig::new({});
+
+# To set $indices_sort_strings, calling
+# Texinfo::Document::indices_sort_strings is more natural, but we want
+# to test direct call of Texinfo::Indices::setup_index_entries_sort_strings.
+# my $indices_sort_strings
+#   = Texinfo::Document::indices_sort_strings($document, $registrar,
+#                                            $main_configuration);
 my $indices_information = $document->indices_information();
 my $index_entries = $document->merged_indices();
-my $main_configuration = Texinfo::MainConfig::new({});
 $main_configuration->{'document_descriptor'}
   = $document->document_descriptor();
 
 my $indices_sort_strings
   = Texinfo::Indices::setup_index_entries_sort_strings($registrar,
                                               $main_configuration,
-                                          $index_entries, 
$indices_information);
+                                      $index_entries, $indices_information);
+
 my $index_entries_sort_strings
   = Texinfo::Indices::format_index_entries_sort_strings($indices_sort_strings);
 
@@ -128,17 +135,11 @@ $document = $parser->parse_texi_text('@node Top
 @cindex @subentry aa
 @cindex hhh @subentry jjj @subentry lll @sortas{A}
 ');
-$tree = $document->tree();
 
 $registrar = $parser->registered_errors();
-$indices_information = $document->indices_information();
-$index_entries = $document->merged_indices();
-$main_configuration->{'document_descriptor'}
-  = $document->document_descriptor();
 $indices_sort_strings
-  = Texinfo::Indices::setup_index_entries_sort_strings($registrar,
-                                               $main_configuration,
-                                          $index_entries, 
$indices_information);
+  = Texinfo::Document::indices_sort_strings($document, $registrar,
+                                            $main_configuration);
 $index_entries_sort_strings
   = Texinfo::Indices::format_index_entries_sort_strings($indices_sort_strings);
 
diff --git a/tp/t/test_utils.pl b/tp/t/test_utils.pl
index 4f899ab679..681ae6154e 100644
--- a/tp/t/test_utils.pl
+++ b/tp/t/test_utils.pl
@@ -1151,9 +1151,9 @@ sub test($$)
   }
 
   # Here the sort strings are generated, both in Perl and XS.
-  # The Perl structure cannot be built yet from XS as the document
-  # index information have not been rebuilt yet, but it is
-  # not needed at that point.
+  # If $XS_structuring is set, the Perl structure cannot be
+  # built yet from XS as the document index information have not
+  # been rebuilt yet, but it is not needed at that point.
   Texinfo::Document::indices_sort_strings($document, $registrar,
                                           $main_configuration);
 



reply via email to

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