texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: t/converters_tests.t: add a test with an input fi


From: Patrice Dumas
Subject: branch master updated: t/converters_tests.t: add a test with an input file without node nor section
Date: Mon, 13 Sep 2021 16:20:17 -0400

This is an automated email from the git hooks/post-receive script.

pertusus pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new f8be52c  t/converters_tests.t: add a test with an input file without 
node nor section
f8be52c is described below

commit f8be52c569acacadd6bacd863a3d757c4f44f201
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Mon Sep 13 22:19:39 2021 +0200

    t/converters_tests.t: add a test with an input file without node nor
    section
---
 tp/t/converters_tests.t                            |  13 +-
 tp/t/input_files/simplest_no_node_section.texi     |   7 +
 .../converters_tests/simplest_no_node_section.pl   | 166 +++++++++++++++++++++
 .../res_docbook/simplest_no_node_section.xml       |  10 ++
 .../simplest_no_node_section/res_html/index.html   |  45 ++++++
 .../res_info/simplest_no_node_section.info         |  15 ++
 .../res_latex/simplest_no_node_section.tex         |  93 ++++++++++++
 .../res_xml/simplest_no_node_section.xml           |  12 ++
 8 files changed, 360 insertions(+), 1 deletion(-)

diff --git a/tp/t/converters_tests.t b/tp/t/converters_tests.t
index f7e0c8d..1498aab 100644
--- a/tp/t/converters_tests.t
+++ b/tp/t/converters_tests.t
@@ -712,6 +712,11 @@ $top_in_ref_text,
 {}, {'KEEP_TOP_EXTERNAL_REF' => 1}],
 );
 
+my @file_tests = (
+['simplest_no_node_section',
+undef, {'test_file' => 'simplest_no_node_section.texi'}
+],
+);
 
 my %info_tests = (
  'image_with_spaces' => 1,
@@ -758,8 +763,14 @@ foreach my $test (@html_text_cases) {
   push @{$test->[2]->{'test_formats'}}, 'html_text';
 }
 
+foreach my $test (@file_tests) {
+  push @{$test->[2]->{'test_formats'}}, 'file_html';
+  push @{$test->[2]->{'test_formats'}}, 'file_info';
+  push @{$test->[2]->{'test_formats'}}, ('file_xml', 'file_docbook', 
'file_latex');
+}
+
 our ($arg_test_case, $arg_generate, $arg_debug);
-run_all ('converters_tests', [@test_cases, @html_text_cases],
+run_all ('converters_tests', [@test_cases, @html_text_cases, @file_tests],
    $arg_test_case, $arg_generate, $arg_debug);
 
 1;
diff --git a/tp/t/input_files/simplest_no_node_section.texi 
b/tp/t/input_files/simplest_no_node_section.texi
new file mode 100644
index 0000000..44eeac4
--- /dev/null
+++ b/tp/t/input_files/simplest_no_node_section.texi
@@ -0,0 +1,7 @@
+\input texinfo @c -*-texinfo-*-
+
+@setfilename simplest_no_node_section.info
+
+This is a very simple texi manual @  <>.
+
+@bye
diff --git a/tp/t/results/converters_tests/simplest_no_node_section.pl 
b/tp/t/results/converters_tests/simplest_no_node_section.pl
new file mode 100644
index 0000000..e7ab910
--- /dev/null
+++ b/tp/t/results/converters_tests/simplest_no_node_section.pl
@@ -0,0 +1,166 @@
+use vars qw(%result_texis %result_texts %result_trees %result_errors 
+   %result_indices %result_sectioning %result_nodes %result_menus
+   %result_floats %result_converted %result_converted_errors 
+   %result_elements %result_directions_text %result_indices_sort_strings);
+
+use utf8;
+
+$result_trees{'simplest_no_node_section'} = {
+  'contents' => [
+    {
+      'contents' => [
+        {
+          'contents' => [
+            {
+              'parent' => {},
+              'text' => '\\input texinfo @c -*-texinfo-*-
+',
+              'type' => 'preamble_text'
+            },
+            {
+              'parent' => {},
+              'text' => '
+',
+              'type' => 'preamble_text'
+            }
+          ],
+          'parent' => {},
+          'type' => 'preamble'
+        }
+      ],
+      'parent' => {},
+      'type' => 'preamble_before_setfilename'
+    },
+    {
+      'args' => [
+        {
+          'contents' => [
+            {
+              'parent' => {},
+              'text' => 'simplest_no_node_section.info'
+            }
+          ],
+          'extra' => {
+            'spaces_after_argument' => '
+'
+          },
+          'parent' => {},
+          'type' => 'line_arg'
+        }
+      ],
+      'cmdname' => 'setfilename',
+      'extra' => {
+        'spaces_before_argument' => ' ',
+        'text_arg' => 'simplest_no_node_section.info'
+      },
+      'line_nr' => {
+        'file_name' => 'simplest_no_node_section.texi',
+        'line_nr' => 3,
+        'macro' => ''
+      },
+      'parent' => {}
+    },
+    {
+      'parent' => {},
+      'text' => '
+',
+      'type' => 'empty_line'
+    },
+    {
+      'contents' => [
+        {
+          'parent' => {},
+          'text' => 'This is a very simple texi manual '
+        },
+        {
+          'cmdname' => ' ',
+          'parent' => {}
+        },
+        {
+          'parent' => {},
+          'text' => ' <>.
+'
+        }
+      ],
+      'parent' => {},
+      'type' => 'paragraph'
+    },
+    {
+      'parent' => {},
+      'text' => '
+',
+      'type' => 'empty_line'
+    },
+    {
+      'args' => [
+        {
+          'parent' => {},
+          'text' => '
+',
+          'type' => 'misc_arg'
+        }
+      ],
+      'cmdname' => 'bye',
+      'parent' => {}
+    }
+  ],
+  'type' => 'text_root'
+};
+$result_trees{'simplest_no_node_section'}{'contents'}[0]{'contents'}[0]{'contents'}[0]{'parent'}
 = $result_trees{'simplest_no_node_section'}{'contents'}[0]{'contents'}[0];
+$result_trees{'simplest_no_node_section'}{'contents'}[0]{'contents'}[0]{'contents'}[1]{'parent'}
 = $result_trees{'simplest_no_node_section'}{'contents'}[0]{'contents'}[0];
+$result_trees{'simplest_no_node_section'}{'contents'}[0]{'contents'}[0]{'parent'}
 = $result_trees{'simplest_no_node_section'}{'contents'}[0];
+$result_trees{'simplest_no_node_section'}{'contents'}[0]{'parent'} = 
$result_trees{'simplest_no_node_section'};
+$result_trees{'simplest_no_node_section'}{'contents'}[1]{'args'}[0]{'contents'}[0]{'parent'}
 = $result_trees{'simplest_no_node_section'}{'contents'}[1]{'args'}[0];
+$result_trees{'simplest_no_node_section'}{'contents'}[1]{'args'}[0]{'parent'} 
= $result_trees{'simplest_no_node_section'}{'contents'}[1];
+$result_trees{'simplest_no_node_section'}{'contents'}[1]{'parent'} = 
$result_trees{'simplest_no_node_section'};
+$result_trees{'simplest_no_node_section'}{'contents'}[2]{'parent'} = 
$result_trees{'simplest_no_node_section'};
+$result_trees{'simplest_no_node_section'}{'contents'}[3]{'contents'}[0]{'parent'}
 = $result_trees{'simplest_no_node_section'}{'contents'}[3];
+$result_trees{'simplest_no_node_section'}{'contents'}[3]{'contents'}[1]{'parent'}
 = $result_trees{'simplest_no_node_section'}{'contents'}[3];
+$result_trees{'simplest_no_node_section'}{'contents'}[3]{'contents'}[2]{'parent'}
 = $result_trees{'simplest_no_node_section'}{'contents'}[3];
+$result_trees{'simplest_no_node_section'}{'contents'}[3]{'parent'} = 
$result_trees{'simplest_no_node_section'};
+$result_trees{'simplest_no_node_section'}{'contents'}[4]{'parent'} = 
$result_trees{'simplest_no_node_section'};
+$result_trees{'simplest_no_node_section'}{'contents'}[5]{'args'}[0]{'parent'} 
= $result_trees{'simplest_no_node_section'}{'contents'}[5];
+$result_trees{'simplest_no_node_section'}{'contents'}[5]{'parent'} = 
$result_trees{'simplest_no_node_section'};
+
+$result_texis{'simplest_no_node_section'} = '\\input texinfo @c -*-texinfo-*-
+
+@setfilename simplest_no_node_section.info
+
+This is a very simple texi manual @  <>.
+
+@bye
+';
+
+
+$result_texts{'simplest_no_node_section'} = '
+This is a very simple texi manual   <>.
+
+';
+
+$result_errors{'simplest_no_node_section'} = [];
+
+
+$result_floats{'simplest_no_node_section'} = {};
+
+
+$result_converted_errors{'file_html'}->{'simplest_no_node_section'} = [
+  {
+    'error_line' => 'simplest_no_node_section.texi: warning: must specify a 
title with a title command or @top
+',
+    'text' => 'must specify a title with a title command or @top',
+    'type' => 'warning'
+  }
+];
+
+
+$result_converted_errors{'file_info'}->{'simplest_no_node_section'} = [
+  {
+    'error_line' => 'simplest_no_node_section.texi: warning: document without 
nodes
+',
+    'text' => 'document without nodes',
+    'type' => 'warning'
+  }
+];
+
+
+1;
diff --git 
a/tp/t/results/converters_tests/simplest_no_node_section/res_docbook/simplest_no_node_section.xml
 
b/tp/t/results/converters_tests/simplest_no_node_section/res_docbook/simplest_no_node_section.xml
new file mode 100644
index 0000000..eeafdc3
--- /dev/null
+++ 
b/tp/t/results/converters_tests/simplest_no_node_section/res_docbook/simplest_no_node_section.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" 
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"; [
+  <!ENTITY tex "TeX">
+  <!ENTITY latex "LaTeX">
+]>
+<book id="simplest_no_node_section.xml" lang="en">
+
+<para>This is a very simple texi manual &#160; &lt;&gt;.
+</para>
+</book>
diff --git 
a/tp/t/results/converters_tests/simplest_no_node_section/res_html/index.html 
b/tp/t/results/converters_tests/simplest_no_node_section/res_html/index.html
new file mode 100644
index 0000000..fb90cb5
--- /dev/null
+++ b/tp/t/results/converters_tests/simplest_no_node_section/res_html/index.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html4/loose.dtd";>
+<html>
+<!-- Created by texinfo, http://www.gnu.org/software/texinfo/ -->
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>Untitled Document</title>
+
+<meta name="description" content="Untitled Document">
+<meta name="keywords" content="Untitled Document">
+<meta name="resource-type" content="document">
+<meta name="distribution" content="global">
+<meta name="viewport" content="width=device-width,initial-scale=1">
+
+<style type="text/css">
+<!--
+a.copiable-anchor {visibility: hidden; text-decoration: none; line-height: 0em}
+a.summary-letter {text-decoration: none}
+blockquote.indentedblock {margin-right: 0em}
+div.display {margin-left: 3.2em}
+div.example {margin-left: 3.2em}
+kbd {font-style: oblique}
+pre.display {font-family: inherit}
+pre.format {font-family: inherit}
+pre.menu-comment {font-family: serif}
+pre.menu-preformatted {font-family: serif}
+span.nolinebreak {white-space: nowrap}
+span.roman {font-family: initial; font-weight: normal}
+span.sansserif {font-family: sans-serif; font-weight: normal}
+span:hover a.copiable-anchor {visibility: visible}
+ul.no-bullet {list-style: none}
+-->
+</style>
+
+
+</head>
+
+<body lang="en">
+
+<p>This is a very simple texi manual &nbsp; &lt;&gt;.
+</p>
+
+
+
+</body>
+</html>
diff --git 
a/tp/t/results/converters_tests/simplest_no_node_section/res_info/simplest_no_node_section.info
 
b/tp/t/results/converters_tests/simplest_no_node_section/res_info/simplest_no_node_section.info
new file mode 100644
index 0000000..1cb8c00
--- /dev/null
+++ 
b/tp/t/results/converters_tests/simplest_no_node_section/res_info/simplest_no_node_section.info
@@ -0,0 +1,15 @@
+This is simplest_no_node_section.info, produced from
+simplest_no_node_section.texi.
+
+This is a very simple texi manual   <>.
+
+
+
+Tag Table:
+
+End Tag Table
+
+
+Local Variables:
+coding: utf-8
+End:
diff --git 
a/tp/t/results/converters_tests/simplest_no_node_section/res_latex/simplest_no_node_section.tex
 
b/tp/t/results/converters_tests/simplest_no_node_section/res_latex/simplest_no_node_section.tex
new file mode 100644
index 0000000..72bbd43
--- /dev/null
+++ 
b/tp/t/results/converters_tests/simplest_no_node_section/res_latex/simplest_no_node_section.tex
@@ -0,0 +1,93 @@
+\documentclass{book}
+\usepackage{imakeidx}
+\usepackage{amsfonts}
+\usepackage{amsmath}
+\usepackage[gen]{eurosym}
+\usepackage[T1]{fontenc}
+\usepackage{textcomp}
+\usepackage{graphicx}
+\usepackage{needspace}
+\usepackage{etoolbox}
+\usepackage{mdframed}
+\usepackage{fontsize}
+\usepackage{enumitem}
+\usepackage{geometry}
+\usepackage{titleps}
+\usepackage{float}
+\usepackage{babel}
+% use hidelinks to remove boxes around links to be similar with Texinfo TeX
+\usepackage[hidelinks]{hyperref}
+\usepackage[utf8]{inputenc}
+
+\newcommand{\GNUTexinfosettitle}{No Title}%
+
+% command used in \description format for indicateurl
+\newcommand\GNUTexinfotablestyleindicateurl[1]{\ifstrempty{#1}{}{`\texttt{#1}'}}%
+
+% command used in \description format for samp
+\newcommand\GNUTexinfotablestylesamp[1]{\ifstrempty{#1}{}{`\texttt{#1}'}}%
+
+% redefine the \mainmatter command such that it does not clear page
+% as if in double page
+\makeatletter
+\renewcommand\mainmatter{\clearpage\@mainmattertrue\pagenumbering{arabic}}
+\makeatother
+% add command aliases to use the same command in book and report
+\newcommand\GNUTexinfomainmatter{\mainmatter}
+\newcommand\GNUTexinfofrontmatter{\frontmatter}
+
+% this allows to select languages based on bcp47 codes.  bcp47 is a superset
+% of the LL_CC ISO 639-2 LL ISO 3166 CC information of @documentlanguage
+\babeladjust{
+  autoload.bcp47 = on,
+  autoload.bcp47.options = import
+}
+
+% set defaults for lists that match Texinfo TeX formatting
+\setlist[description]{style=nextline, font=\normalfont}
+\setlist[itemize]{label=\textbullet}
+\setlist[enumerate]{label=\arabic*.}
+
+% command that does nothing used to help with substitutions in commands
+\newcommand{\GNUTexinfoplaceholder}[1]{}
+
+% plain page style, for part and chapter, which call \thispagestyle{plain}
+\renewpagestyle{plain}{\sethead[\thepage{}][][]
+                             {}{}{\thepage{}}}
+
+% single header
+\newpagestyle{single}{\sethead[\chaptername{} \thechapter{} 
\chaptertitle{}][][\thepage]
+                              {\chaptername{} \thechapter{} 
\chaptertitle{}}{}{\thepage}}
+
+% called when setting single headers
+\newcommand{\GNUTexinfosetsingleheader}{\pagestyle{single}}
+
+% double header
+\newpagestyle{double}{\sethead[\thepage{}][][\GNUTexinfosettitle]
+                              {\chaptername{} \thechapter{} 
\chaptertitle{}}{}{\thepage}}
+
+% called when setting double headers
+\newcommand{\GNUTexinfosetdoubleheader}{\pagestyle{double}}
+
+
+% avoid pagebreak and headings setting for a sectionning command
+\newcommand{\GNUTexinfonopagebreakheading}[2]{\let\clearpage\relax 
\let\cleardoublepage\relax \let\thispagestyle\GNUTexinfoplaceholder #1{#2}}
+
+% the mdframed style for @cartouche
+\mdfdefinestyle{GNUTexinfocartouche}{
+innertopmargin=10pt, innerbottommargin=10pt,%
+roundcorner=10pt}
+
+\renewcommand{\includegraphics}[1]{\fbox{FIG #1}}
+
+% set default for @setchapternewpage
+\makeatletter
+\patchcmd{\chapter}{\if@openright\cleardoublepage\else\clearpage\fi}{\GNUTexinfoplaceholder{setchapternewpage
 placeholder}\clearpage}{}{}
+\makeatother
+\GNUTexinfosetsingleheader{}%
+
+
+\begin{document}
+This is a very simple texi manual \ {} <>.
+
+\end{document}
diff --git 
a/tp/t/results/converters_tests/simplest_no_node_section/res_xml/simplest_no_node_section.xml
 
b/tp/t/results/converters_tests/simplest_no_node_section/res_xml/simplest_no_node_section.xml
new file mode 100644
index 0000000..5b4a5da
--- /dev/null
+++ 
b/tp/t/results/converters_tests/simplest_no_node_section/res_xml/simplest_no_node_section.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<!DOCTYPE texinfo PUBLIC "-//GNU//DTD TexinfoML V5.0//EN" 
"http://www.gnu.org/software/texinfo/dtd/5.0/texinfo.dtd";>
+<texinfo>
+<filename file="simplest_no_node_section.xml"></filename>
+<preamble>\input texinfo @c -*-texinfo-*-
+
+</preamble><setfilename file="simplest_no_node_section.info" spaces=" 
">simplest_no_node_section.info</setfilename>
+
+<para>This is a very simple texi manual <spacecmd type="spc"/> &lt;&gt;.
+</para>
+<bye></bye>
+</texinfo>



reply via email to

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