[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: Add test demonstrating incorrect setting of docum
From: |
Patrice Dumas |
Subject: |
branch master updated: Add test demonstrating incorrect setting of documentlanguage in Parser, not having command line overriding the value set in the document. |
Date: |
Tue, 24 Aug 2021 18:25:23 -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 12e9ffb Add test demonstrating incorrect setting of documentlanguage
in Parser, not having command line overriding the value set in the document.
12e9ffb is described below
commit 12e9ffb13faf44d188e418b0be7ecaf42b5d1426
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Wed Aug 25 00:23:35 2021 +0200
Add test demonstrating incorrect setting of documentlanguage
in Parser, not having command line overriding the value set in the
document.
---
tp/tests/formatting/documentlanguage.texi | 39 ++++
tp/tests/formatting/list-of-tests | 3 +
.../documentlanguage_cmdline/documentlanguage.1 | 0
.../documentlanguage_cmdline/documentlanguage.2 | 0
.../documentlanguage_cmdline/documentlanguage.html | 211 +++++++++++++++++++++
.../formatting_documentlanguage_cmdline.sh | 19 ++
6 files changed, 272 insertions(+)
diff --git a/tp/tests/formatting/documentlanguage.texi
b/tp/tests/formatting/documentlanguage.texi
new file mode 100644
index 0000000..59fb8e8
--- /dev/null
+++ b/tp/tests/formatting/documentlanguage.texi
@@ -0,0 +1,39 @@
+\input texinfo @c -*-texinfo-*-
+
+@c this document is setup to detect when the documentlanguage was not
+@c set according to command line, but according to document. This
+@c can mostly happen in Parser, as any converter being initialized with
+@c Texinfo::Convert::Converter converter() and with values accessed by
+@c get_conf() will use the command line.
+@c This is tricky to demonstrate, as documentlanguge is not used much
+@c in Parser. It is used in two places to set the documentlanguage extra
+@c value,
+@c 1) for the untranslated type, for the prefix of @def* and
+@c 2) for the @def* line commands with added index entries that need to
+@c be translated, like '{name} of {class}'.
+@c The untranslated type is in general translated in the converters
+@c without using the extra documentlanguage key value, so getting it
+@c wrong does not have any consequence.
+@c The @def* translated added indices are translated relatively early,
+@c before the converter, and the extra documentlanguage key is used to
+@c get the language, so if the wrong language is set, it will show up
+@c in the index generated by @printindex.
+@setfilename documentlanguage.info
+
+@documentlanguage pt
+
+@node Top
+@top top section
+
+@node chapter
+@chapter Chapter
+
+@xref{chapter}.
+
+@deftypemethod class data-type name arguments
+Some text.
+@end deftypemethod
+
+@printindex fn
+
+@bye
diff --git a/tp/tests/formatting/list-of-tests
b/tp/tests/formatting/list-of-tests
index 2d87e73..1812a91 100644
--- a/tp/tests/formatting/list-of-tests
+++ b/tp/tests/formatting/list-of-tests
@@ -6,3 +6,6 @@ test_redefine_need test_need.texi --init redefine_need.init
# FIXME /dev/null not portable
split_nocopying_split_dev_null split_nocopying.texi --info --split-size 1 -o
/dev/null
simplest_test_css simplest.texi --css-include file.css
+
+# check that command line overrides document
+documentlanguage_cmdline documentlanguage.texi --document-language=fr
diff --git
a/tp/tests/formatting/res_parser/documentlanguage_cmdline/documentlanguage.1
b/tp/tests/formatting/res_parser/documentlanguage_cmdline/documentlanguage.1
new file mode 100644
index 0000000..e69de29
diff --git
a/tp/tests/formatting/res_parser/documentlanguage_cmdline/documentlanguage.2
b/tp/tests/formatting/res_parser/documentlanguage_cmdline/documentlanguage.2
new file mode 100644
index 0000000..e69de29
diff --git
a/tp/tests/formatting/res_parser/documentlanguage_cmdline/documentlanguage.html
b/tp/tests/formatting/res_parser/documentlanguage_cmdline/documentlanguage.html
new file mode 100644
index 0000000..4e03ce6
--- /dev/null
+++
b/tp/tests/formatting/res_parser/documentlanguage_cmdline/documentlanguage.html
@@ -0,0 +1,211 @@
+<!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>top section</title>
+
+<meta name="description" content="top section">
+<meta name="keywords" content="top section">
+<meta name="resource-type" content="document">
+<meta name="distribution" content="global">
+<meta name="Generator" content="texi2any">
+<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="fr">
+
+
+<div class="top" id="Top">
+<table class="header" cellpadding="1" cellspacing="1" border="0">
+<tr><td valign="middle" align="left">[ < ]</td>
+<td valign="middle" align="left">[<a href="#chapter" title="Section suivante
dans l’ordre de lecture"> > </a>]</td>
+<td valign="middle" align="left"> </td>
+<td valign="middle" align="left">[Table des matières]</td>
+<td valign="middle" align="left">[<a href="#chapter"
title="Index">Index</a>]</td>
+<td valign="middle" align="left">[<a href="#SEC_About" title="A propos (page
d’aide)"> ? </a>]</td>
+</tr></table>
+<span id="top-section"></span><h1 class="top">top section</h1>
+
+<hr size="6">
+<div class="chapter" id="chapter">
+<table class="header" cellpadding="1" cellspacing="1" border="0">
+<tr><td valign="middle" align="left">[<a href="#Top" title="Début de ce
chapitre ou chapitre précédent"> << </a>]</td>
+<td valign="middle" align="left">[<a href="#Top" title="Section
précédente dans l’ordre de lecture"> < </a>]</td>
+<td valign="middle" align="left">[<a href="#Top" title="Section
supérieure">Plus haut</a>]</td>
+<td valign="middle" align="left">[ > ]</td>
+<td valign="middle" align="left">[ >> ]</td>
+<td valign="middle" align="left"> </td>
+<td valign="middle" align="left"> </td>
+<td valign="middle" align="left"> </td>
+<td valign="middle" align="left"> </td>
+<td valign="middle" align="left">[<a href="#Top" title="Couverture (top) du
document">Racine</a>]</td>
+<td valign="middle" align="left">[Table des matières]</td>
+<td valign="middle" align="left">[<a href="#chapter"
title="Index">Index</a>]</td>
+<td valign="middle" align="left">[<a href="#SEC_About" title="A propos (page
d’aide)"> ? </a>]</td>
+</tr></table>
+<span id="Chapter"></span><h1 class="chapter">1 Chapter</h1>
+
+<p>Voir <a href="#chapter">Chapter</a>.
+</p>
+<dl class="def">
+<dt id="index-name-on-class"><span>Méthode de class :
<em>data-type</em> <strong>name</strong> <em>arguments</em><a
href='#index-name-on-class' class='copiable-anchor'> ¶</a></span></dt>
+<dd><p>Some text.
+</p></dd></dl>
+
+<table><tr><th valign="top">Aller à: </th><td><a
class="summary-letter" href="#Chapter_fn_letter-N"><b>N</b></a>
+
+</td></tr></table>
+<table class="index-fn" border="0">
+<tr><td></td><th align="left">Entrée
d’index</th><td> </td><th align="left"> Section</th></tr>
+<tr><td colspan="4"> <hr></td></tr>
+<tr><th id="Chapter_fn_letter-N">N</th><td></td><td></td></tr>
+<tr><td></td><td valign="top"><a href="#index-name-on-class"><code>name na
class</code></a></td><td> </td><td valign="top"><a href="#chapter">1
Chapter</a></td></tr>
+<tr><td colspan="4"> <hr></td></tr>
+</table>
+<table><tr><th valign="top">Aller à: </th><td><a
class="summary-letter" href="#Chapter_fn_letter-N"><b>N</b></a>
+
+</td></tr></table>
+
+<hr size="6">
+</div>
+</div>
+<div class="About_element" id="SEC_About">
+<table class="header" cellpadding="1" cellspacing="1" border="0">
+<tr><td valign="middle" align="left">[<a href="#Top" title="Couverture (top)
du document">Racine</a>]</td>
+<td valign="middle" align="left">[Table des matières]</td>
+<td valign="middle" align="left">[<a href="#chapter"
title="Index">Index</a>]</td>
+<td valign="middle" align="left">[<a href="#SEC_About" title="A propos (page
d’aide)"> ? </a>]</td>
+</tr></table>
+<h1 class="about-heading">A propos de ce document</h1>
+
+<p>
+ Ce document a été généré <em>a sunny
day</em> en utilisant <a
href="http://www.gnu.org/software/texinfo/"><em>texi2any</em></a>.
+</p>
+<p>
+ Les boutons du panneau de navigation ont la signification suivante :
+</p>
+<table border="1">
+ <tr>
+ <th> Bouton </th>
+ <th> Nom </th>
+ <th> Aller à </th>
+ <th> Depuis 1.2.3 aller à</th>
+ </tr>
+ <tr>
+ <td align="center"> [ << ] </td>
+ <td align="center">RetourRapide</td>
+ <td>Début de ce chapitre ou chapitre précédent</td>
+ <td>1</td>
+ </tr>
+ <tr>
+ <td align="center"> [ < ] </td>
+ <td align="center">Arrière</td>
+ <td>Section précédente dans l’ordre de lecture</td>
+ <td>1.2.2</td>
+ </tr>
+ <tr>
+ <td align="center"> [Plus haut] </td>
+ <td align="center">Monter</td>
+ <td>Section supérieure</td>
+ <td>1.2</td>
+ </tr>
+ <tr>
+ <td align="center"> [ > ] </td>
+ <td align="center">Avant</td>
+ <td>Section suivante dans l’ordre de lecture</td>
+ <td>1.2.4</td>
+ </tr>
+ <tr>
+ <td align="center"> [ >> ] </td>
+ <td align="center">AvanceRapide</td>
+ <td>Chapitre suivant</td>
+ <td>2</td>
+ </tr>
+ <tr>
+ <td align="center"> [Racine] </td>
+ <td align="center">Racine</td>
+ <td>Couverture (top) du document</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td align="center"> [Table des matières] </td>
+ <td align="center">Table des matières</td>
+ <td>Table des matières</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td align="center"> [Index] </td>
+ <td align="center">Index</td>
+ <td>Index</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td align="center"> [ ? ] </td>
+ <td align="center">A propos</td>
+ <td>A propos (page d’aide)</td>
+ <td> </td>
+ </tr>
+</table>
+
+<p>
+ Dans cet exemple on est à <strong> Sous-sous-section un-deux-trois
</strong> dans un document dont la structure est :
+</p>
+
+<ul>
+ <li> 1. Section un
+ <ul>
+ <li>1.1 Sous-section un-un
+ <ul>
+ <li>...</li>
+ </ul>
+ </li>
+ <li>1.2 Sous-section un-deux
+ <ul>
+ <li>1.2.1 Sous-sous-section un-deux-un</li>
+ <li>1.2.2 Sous-sous-section un-deux-deux</li>
+ <li>1.2.3 Sous-sous-section un-deux-trois
+ <strong><== Position actuelle </strong></li>
+ <li>1.2.4 Sous-sous-section un-deux-quatre</li>
+ </ul>
+ </li>
+ <li>1.3 Sous-section un-trois
+ <ul>
+ <li>...</li>
+ </ul>
+ </li>
+ <li>1.4 Sous-section un-quatre</li>
+ </ul>
+ </li>
+</ul>
+
+</div><hr>
+<p><font size="-1">
+ Ce document a été généré <em>a sunny
day</em> en utilisant <a
href="http://www.gnu.org/software/texinfo/"><em>texi2any</em></a>.
+</font></p>
+
+
+</body>
+</html>
diff --git a/tp/tests/test_scripts/formatting_documentlanguage_cmdline.sh
b/tp/tests/test_scripts/formatting_documentlanguage_cmdline.sh
new file mode 100755
index 0000000..a0d322d
--- /dev/null
+++ b/tp/tests/test_scripts/formatting_documentlanguage_cmdline.sh
@@ -0,0 +1,19 @@
+#! /bin/sh
+# This file generated by maintain/regenerate_cmd_tests.sh
+
+if test z"$srcdir" = "z"; then
+ srcdir=.
+fi
+
+one_test_logs_dir=test_log
+
+
+dir=formatting
+name='documentlanguage_cmdline'
+mkdir -p $dir
+
+"$srcdir"/run_parser_all.sh -dir $dir $name
+exit_status=$?
+cat $dir/$one_test_logs_dir/$name.log
+exit $exit_status
+
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: Add test demonstrating incorrect setting of documentlanguage in Parser, not having command line overriding the value set in the document.,
Patrice Dumas <=