texinfo-commits
[Top][All Lists]
Advanced

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

[no subject]


From: Patrice Dumas
Date: Sat, 1 Oct 2022 17:41:20 -0400 (EDT)

branch: master
commit 616db91cbb6a42f6f5c91bef9fe54052a2bb2a87
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sat Oct 1 23:40:31 2022 +0200

    Move some @example tests out of html tests to generic preformatted tests
    Regenerate test results.
---
 tp/t/20preformatted.t                              | 48 +++++++++++++
 tp/t/html_tests.t                                  | 48 -------------
 tp/t/results/indices/subentry_and_sortas_spaces.pl |  3 +
 .../example_at_commands_arguments.pl               | 22 ++++++
 .../{html_tests => preformatted}/example_class.pl  | 50 +++++++++++++
 .../example_empty_arguments.pl                     | 50 +++++++++++++
 .../example_multi_class.pl                         | 82 ++++++++++++++++++++--
 7 files changed, 251 insertions(+), 52 deletions(-)

diff --git a/tp/t/20preformatted.t b/tp/t/20preformatted.t
index 775050556d..7b33708d61 100644
--- a/tp/t/20preformatted.t
+++ b/tp/t/20preformatted.t
@@ -186,6 +186,54 @@ text
 text
 @end example
 '],
+['example_class',
+'@example perl
+foreach my $unclosed_file (keys(%unclosed_files)) @{
+  if (!close($unclosed_files@{$unclosed_file@})) @{
+    warn(sprintf("%s: error on closing %s: %s\n",
+                     $real_command_name, $unclosed_file, $!));
+    $error_count++;
+    _exit($error_count, \@@opened_files);
+  @}
+@}
+@end example
+'],
+['example_multi_class',
+'@example C++ , gothic, purple, embed
+void StateManager::deallocate() @{
+    if(buffer) @{
+        delete [] buffer;
+        buffer = NULL;
+    @}
+    if(tmp_state) @{
+        delete [] tmp_state;
+        tmp_state = NULL;
+    @}
+    if(in_state) @{
+        delete [] in_state;
+        in_state = NULL;
+    @}
+@}
+@end example
+'],
+['example_empty_arguments',
+'@example ,,,,,,
+example with empty args
+@end example
+
+@example , ,,  ,,, 
+example with empty args with spaces
+@end example
+
+@example ,,,nonempty,,,
+example with empty and non empty args mix
+@end example
+'],
+['example_at_commands_arguments',
+'@example some  thing @^e @TeX{} @exclamdown{} @code{---} @enddots{} !_- _---_ 
< " & @ @comma{},@@,0
+example with @@-commands and other special characters
+@end example
+'],
 );
 
 my @test_invalid = (
diff --git a/tp/t/html_tests.t b/tp/t/html_tests.t
index 7233af6292..8411985995 100644
--- a/tp/t/html_tests.t
+++ b/tp/t/html_tests.t
@@ -539,54 +539,6 @@ In top.
 @summarycontents
 
 ', {}, {'SHOW_TITLE' => 1, 'CONTENTS_OUTPUT_LOCATION' => 'after_title'}],
-['example_class',
-'@example perl
-foreach my $unclosed_file (keys(%unclosed_files)) @{
-  if (!close($unclosed_files@{$unclosed_file@})) @{
-    warn(sprintf("%s: error on closing %s: %s\n",
-                     $real_command_name, $unclosed_file, $!));
-    $error_count++;
-    _exit($error_count, \@@opened_files);
-  @}
-@}
-@end example
-'],
-['example_multi_class',
-'@example C++ , gothic, purple, embed
-void StateManager::deallocate() @{
-    if(buffer) @{
-        delete [] buffer;
-        buffer = NULL;
-    @}
-    if(tmp_state) @{
-        delete [] tmp_state;
-        tmp_state = NULL;
-    @}
-    if(in_state) @{
-        delete [] in_state;
-        in_state = NULL;
-    @}
-@} 
-@end example
-'],
-['example_empty_arguments',
-'@example ,,,,,,
-example with empty args
-@end example
-
-@example , ,,  ,,, 
-example with empty args with spaces
-@end example
-
-@example ,,,nonempty,,,
-example with empty and non empty args mix
-@end example
-'],
-['example_at_commands_arguments',
-'@example some  thing @^e @TeX{} @exclamdown{} @code{---} @enddots{} !_- _---_ 
< " & @ @comma{},@@,0
-example with @@-commands and other special characters
-@end example
-'],
 ['uref_accented_letter',
 '@uref{http://example.com/acc_@"a@ogonek{a}}
 '],
diff --git a/tp/t/results/indices/subentry_and_sortas_spaces.pl 
b/tp/t/results/indices/subentry_and_sortas_spaces.pl
index 8fa14a6849..ef906d6f19 100644
--- a/tp/t/results/indices/subentry_and_sortas_spaces.pl
+++ b/tp/t/results/indices/subentry_and_sortas_spaces.pl
@@ -990,6 +990,9 @@ $result_converted{'latex'}->{'subentry_and_sortas_spaces'} 
= '\\documentclass{bo
 \\newpagestyle{single}{\\sethead[\\chaptername{} \\thechapter{} 
\\chaptertitle{}][][\\thepage]
                               {\\chaptername{} \\thechapter{} 
\\chaptertitle{}}{}{\\thepage}}
 
+% allow line breaking at underscore
+\\let\\GNUTexinfounderscore\\_
+\\renewcommand{\\_}{\\GNUTexinfounderscore\\discretionary{}{}{}}
 \\renewcommand{\\includegraphics}[1]{\\fbox{FIG \\detokenize{#1}}}
 
 \\makeatother
diff --git a/tp/t/results/html_tests/example_at_commands_arguments.pl 
b/tp/t/results/preformatted/example_at_commands_arguments.pl
similarity index 94%
rename from tp/t/results/html_tests/example_at_commands_arguments.pl
rename to tp/t/results/preformatted/example_at_commands_arguments.pl
index 720e0e4360..24c1626516 100644
--- a/tp/t/results/html_tests/example_at_commands_arguments.pl
+++ b/tp/t/results/preformatted/example_at_commands_arguments.pl
@@ -292,6 +292,10 @@ $result_floats{'example_at_commands_arguments'} = {};
 
 
 
+$result_converted{'plaintext'}->{'example_at_commands_arguments'} = '     
example with @-commands and other special characters
+';
+
+
 $result_converted{'html'}->{'example_at_commands_arguments'} = '<!DOCTYPE html>
 <html>
 <!-- Created by texinfo, http://www.gnu.org/software/texinfo/ -->
@@ -336,4 +340,22 @@ 
$result_converted_errors{'html'}->{'example_at_commands_arguments'} = [
 ];
 
 
+
+$result_converted{'docbook'}->{'example_at_commands_arguments'} = 
'<screen>example with @-commands and other special characters
+</screen>';
+
+
+$result_converted{'xml'}->{'example_at_commands_arguments'} = '<example 
spaces=" " endspaces=" "><examplelanguage>some  thing <accent type="circ" 
bracketed="off">e</accent> &tex; &iexcl; <code>---</code> &enddots; !_- 
_&textmdash;_ &lt; &quot; &amp; <spacecmd 
type="spc"/>&comma;</examplelanguage><examplearg>&arobase;</examplearg><examplearg>0</examplearg>
+<pre xml:space="preserve">example with &arobase;-commands and other special 
characters
+</pre></example>
+';
+
+
+$result_converted{'latex_text'}->{'example_at_commands_arguments'} = 
'\\begin{GNUTexinfoindented}
+\\begin{GNUTexinfopreformatted}%
+\\ttfamily example with @-commands and other special characters
+\\end{GNUTexinfopreformatted}
+\\end{GNUTexinfoindented}
+';
+
 1;
diff --git a/tp/t/results/html_tests/example_class.pl 
b/tp/t/results/preformatted/example_class.pl
similarity index 86%
rename from tp/t/results/html_tests/example_class.pl
rename to tp/t/results/preformatted/example_class.pl
index 3a539baccc..47f95bb6eb 100644
--- a/tp/t/results/html_tests/example_class.pl
+++ b/tp/t/results/preformatted/example_class.pl
@@ -233,6 +233,17 @@ $result_floats{'example_class'} = {};
 
 
 
+$result_converted{'plaintext'}->{'example_class'} = '     foreach my 
$unclosed_file (keys(%unclosed_files)) {
+       if (!close($unclosed_files{$unclosed_file})) {
+         warn(sprintf("%s: error on closing %s: %s\\n",
+                          $real_command_name, $unclosed_file, $!));
+         $error_count++;
+         _exit($error_count, \\@opened_files);
+       }
+     }
+';
+
+
 $result_converted{'html'}->{'example_class'} = '<!DOCTYPE html>
 <html>
 <!-- Created by texinfo, http://www.gnu.org/software/texinfo/ -->
@@ -284,4 +295,43 @@ $result_converted_errors{'html'}->{'example_class'} = [
 ];
 
 
+
+$result_converted{'docbook'}->{'example_class'} = '<screen>foreach my 
$unclosed_file (keys(%unclosed_files)) {
+  if (!close($unclosed_files{$unclosed_file})) {
+    warn(sprintf(&quot;%s: error on closing %s: %s\\n&quot;,
+                     $real_command_name, $unclosed_file, $!));
+    $error_count++;
+    _exit($error_count, \\@opened_files);
+  }
+}
+</screen>';
+
+
+$result_converted{'xml'}->{'example_class'} = '<example spaces=" " endspaces=" 
"><examplelanguage>perl</examplelanguage>
+<pre xml:space="preserve">foreach my $unclosed_file (keys(%unclosed_files)) 
&lbrace;
+  if (!close($unclosed_files&lbrace;$unclosed_file&rbrace;)) &lbrace;
+    warn(sprintf(&quot;%s: error on closing %s: %s\\n&quot;,
+                     $real_command_name, $unclosed_file, $!));
+    $error_count++;
+    _exit($error_count, \\&arobase;opened_files);
+  &rbrace;
+&rbrace;
+</pre></example>
+';
+
+
+$result_converted{'latex_text'}->{'example_class'} = 
'\\begin{GNUTexinfoindented}
+\\begin{GNUTexinfopreformatted}%
+\\ttfamily foreach my \\$unclosed\\_file (keys(\\%unclosed\\_files)) \\{
+\\  if (!close(\\$unclosed\\_files\\{\\$unclosed\\_file\\})) \\{
+\\    warn(sprintf("\\%s:\\ error on closing \\%s:\\ \\%s\\textbackslash{}n",
+\\                     \\$real\\_command\\_name,\\ \\$unclosed\\_file,\\ 
\\$!));
+\\    \\$error\\_count++;
+\\    \\_exit(\\$error\\_count,\\ \\textbackslash{}@opened\\_files);
+\\  \\}
+\\}
+\\end{GNUTexinfopreformatted}
+\\end{GNUTexinfoindented}
+';
+
 1;
diff --git a/tp/t/results/html_tests/example_empty_arguments.pl 
b/tp/t/results/preformatted/example_empty_arguments.pl
similarity index 90%
rename from tp/t/results/html_tests/example_empty_arguments.pl
rename to tp/t/results/preformatted/example_empty_arguments.pl
index 3a260062da..192b845a46 100644
--- a/tp/t/results/html_tests/example_empty_arguments.pl
+++ b/tp/t/results/preformatted/example_empty_arguments.pl
@@ -376,6 +376,14 @@ $result_floats{'example_empty_arguments'} = {};
 
 
 
+$result_converted{'plaintext'}->{'example_empty_arguments'} = '     example 
with empty args
+
+     example with empty args with spaces
+
+     example with empty and non empty args mix
+';
+
+
 $result_converted{'html'}->{'example_empty_arguments'} = '<!DOCTYPE html>
 <html>
 <!-- Created by texinfo, http://www.gnu.org/software/texinfo/ -->
@@ -428,4 +436,46 @@ 
$result_converted_errors{'html'}->{'example_empty_arguments'} = [
 ];
 
 
+
+$result_converted{'docbook'}->{'example_empty_arguments'} = '<screen>example 
with empty args
+</screen>
+<screen>example with empty args with spaces
+</screen>
+<screen>example with empty and non empty args mix
+</screen>';
+
+
+$result_converted{'xml'}->{'example_empty_arguments'} = '<example spaces=" " 
endspaces=" 
"><examplearg></examplearg><examplearg></examplearg><examplearg></examplearg><examplearg></examplearg><examplearg></examplearg><examplearg></examplearg>
+<pre xml:space="preserve">example with empty args
+</pre></example>
+
+<example spaces=" " endspaces=" "><examplearg spaces=" 
"></examplearg><examplearg></examplearg><examplearg spaces="  
"></examplearg><examplearg></examplearg><examplearg></examplearg><examplearg> 
</examplearg>
+<pre xml:space="preserve">example with empty args with spaces
+</pre></example>
+
+<example spaces=" " endspaces=" 
"><examplearg></examplearg><examplearg></examplearg><examplearg>nonempty</examplearg><examplearg></examplearg><examplearg></examplearg><examplearg></examplearg>
+<pre xml:space="preserve">example with empty and non empty args mix
+</pre></example>
+';
+
+
+$result_converted{'latex_text'}->{'example_empty_arguments'} = 
'\\begin{GNUTexinfoindented}
+\\begin{GNUTexinfopreformatted}%
+\\ttfamily example with empty args
+\\end{GNUTexinfopreformatted}
+\\end{GNUTexinfoindented}
+
+\\begin{GNUTexinfoindented}
+\\begin{GNUTexinfopreformatted}%
+\\ttfamily example with empty args with spaces
+\\end{GNUTexinfopreformatted}
+\\end{GNUTexinfoindented}
+
+\\begin{GNUTexinfoindented}
+\\begin{GNUTexinfopreformatted}%
+\\ttfamily example with empty and non empty args mix
+\\end{GNUTexinfopreformatted}
+\\end{GNUTexinfoindented}
+';
+
 1;
diff --git a/tp/t/results/html_tests/example_multi_class.pl 
b/tp/t/results/preformatted/example_multi_class.pl
similarity index 89%
rename from tp/t/results/html_tests/example_multi_class.pl
rename to tp/t/results/preformatted/example_multi_class.pl
index e8e4946b08..b581e2aabd 100644
--- a/tp/t/results/html_tests/example_multi_class.pl
+++ b/tp/t/results/preformatted/example_multi_class.pl
@@ -197,7 +197,7 @@ $result_trees{'example_multi_class'} = {
                 },
                 {
                   'parent' => {},
-                  'text' => ' 
+                  'text' => '
 '
                 }
               ],
@@ -309,7 +309,7 @@ void StateManager::deallocate() @{
         delete [] in_state;
         in_state = NULL;
     @}
-@} 
+@}
 @end example
 ';
 
@@ -327,7 +327,7 @@ $result_texts{'example_multi_class'} = 'void 
StateManager::deallocate() {
         delete [] in_state;
         in_state = NULL;
     }
-} 
+}
 ';
 
 $result_errors{'example_multi_class'} = [];
@@ -337,6 +337,23 @@ $result_floats{'example_multi_class'} = {};
 
 
 
+$result_converted{'plaintext'}->{'example_multi_class'} = '     void 
StateManager::deallocate() {
+         if(buffer) {
+             delete [] buffer;
+             buffer = NULL;
+         }
+         if(tmp_state) {
+             delete [] tmp_state;
+             tmp_state = NULL;
+         }
+         if(in_state) {
+             delete [] in_state;
+             in_state = NULL;
+         }
+     }
+';
+
+
 $result_converted{'html'}->{'example_multi_class'} = '<!DOCTYPE html>
 <html>
 <!-- Created by texinfo, http://www.gnu.org/software/texinfo/ -->
@@ -374,7 +391,7 @@ div.example {margin-left: 3.2em}
         delete [] in_state;
         in_state = NULL;
     }
-} 
+}
 </pre></div>
 
 
@@ -394,4 +411,61 @@ $result_converted_errors{'html'}->{'example_multi_class'} 
= [
 ];
 
 
+
+$result_converted{'docbook'}->{'example_multi_class'} = '<screen>void 
StateManager::deallocate() {
+    if(buffer) {
+        delete [] buffer;
+        buffer = NULL;
+    }
+    if(tmp_state) {
+        delete [] tmp_state;
+        tmp_state = NULL;
+    }
+    if(in_state) {
+        delete [] in_state;
+        in_state = NULL;
+    }
+}
+</screen>';
+
+
+$result_converted{'xml'}->{'example_multi_class'} = '<example spaces=" " 
endspaces=" "><examplelanguage>C++</examplelanguage><examplearg spaces=" 
">gothic</examplearg><examplearg spaces=" ">purple</examplearg><examplearg 
spaces=" ">embed</examplearg>
+<pre xml:space="preserve">void StateManager::deallocate() &lbrace;
+    if(buffer) &lbrace;
+        delete [] buffer;
+        buffer = NULL;
+    &rbrace;
+    if(tmp_state) &lbrace;
+        delete [] tmp_state;
+        tmp_state = NULL;
+    &rbrace;
+    if(in_state) &lbrace;
+        delete [] in_state;
+        in_state = NULL;
+    &rbrace;
+&rbrace;
+</pre></example>
+';
+
+
+$result_converted{'latex_text'}->{'example_multi_class'} = 
'\\begin{GNUTexinfoindented}
+\\begin{GNUTexinfopreformatted}%
+\\ttfamily void StateManager::deallocate() \\{
+\\    if(buffer) \\{
+\\        delete [] buffer;
+\\        buffer = NULL;
+\\    \\}
+\\    if(tmp\\_state) \\{
+\\        delete [] tmp\\_state;
+\\        tmp\\_state = NULL;
+\\    \\}
+\\    if(in\\_state) \\{
+\\        delete [] in\\_state;
+\\        in\\_state = NULL;
+\\    \\}
+\\}
+\\end{GNUTexinfopreformatted}
+\\end{GNUTexinfoindented}
+';
+
 1;



reply via email to

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