[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Patrice Dumas |
Date: |
Sun, 19 Feb 2023 17:11:24 -0500 (EST) |
branch: master
commit 60dc714ec2a410c2c1e1776d943343472d38f72c
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sun Feb 19 23:11:12 2023 +0100
* tp/tests/Makefile.onetst, tp/tests/other/list-of-tests: add a test
of HIGHLIGHT_SYNTAX_DEFAULT_LANGUAGE.
---
ChangeLog | 5 ++
tp/tests/Makefile.onetst | 1 +
tp/tests/other/list-of-tests | 2 +
.../chapter.html | 91 ++++++++++++++++++++++
.../highlight_example.1 | 0
.../highlight_example.2 | 0
.../highlight_example_highlight_C_input.C | 12 +++
.../highlight_example_highlight_C_output.html | 15 ++++
.../highlight_example_highlight_perl_input.pl | 22 ++++++
.../highlight_example_highlight_perl_output.html | 23 ++++++
.../highlight_example_highlight_texinfo_input.texi | 6 ++
...highlight_example_highlight_texinfo_output.html | 9 +++
.../index.html | 49 ++++++++++++
...er_highlight_syntax_example_default_language.sh | 25 ++++++
14 files changed, 260 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index 818d8eb3ae..c0ef85394e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2023-02-19 Patrice Dumas <pertusus@free.fr>
+
+ * tp/tests/Makefile.onetst, tp/tests/other/list-of-tests: add a test
+ of HIGHLIGHT_SYNTAX_DEFAULT_LANGUAGE.
+
2023-02-19 Patrice Dumas <pertusus@free.fr>
* tp/ext/highlight_syntax.pm (highlight_setup, highlight_process):
diff --git a/tp/tests/Makefile.onetst b/tp/tests/Makefile.onetst
index d2e3f1f1a4..714af6e1ff 100644
--- a/tp/tests/Makefile.onetst
+++ b/tp/tests/Makefile.onetst
@@ -133,5 +133,6 @@ type_other_one_test_files_generated_list = \
test_scripts/other_highlight_syntax_example.sh \
test_scripts/other_highlight_syntax_example_pygments.sh \
test_scripts/other_highlight_syntax_example_highlight.sh \
+ test_scripts/other_highlight_syntax_example_default_language.sh \
test_scripts/other_highlight_syntax_example_latin9.sh
diff --git a/tp/tests/other/list-of-tests b/tp/tests/other/list-of-tests
index 3e2252a7aa..86952c7e65 100644
--- a/tp/tests/other/list-of-tests
+++ b/tp/tests/other/list-of-tests
@@ -3,4 +3,6 @@ highlight_syntax_example highlight_example.texi --html -c
HIGHLIGHT_SYNTAX=1
highlight_syntax_example_pygments highlight_example.texi --html -c
HIGHLIGHT_SYNTAX=pygments
highlight_syntax_example_highlight highlight_example.texi --html -c
HIGHLIGHT_SYNTAX=highlight
+highlight_syntax_example_default_language highlight_example.texi --html -c
HIGHLIGHT_SYNTAX=1 -c HIGHLIGHT_SYNTAX_DEFAULT_LANGUAGE=Perl
+
highlight_syntax_example_latin9 highlight_example.texi --html
--init=highlight_syntax.pm -c 'OUTPUT_ENCODING_NAME=ISO-8859-15'
diff --git
a/tp/tests/other/res_parser/highlight_syntax_example_default_language/chapter.html
b/tp/tests/other/res_parser/highlight_syntax_example_default_language/chapter.html
new file mode 100644
index 0000000000..7f2411cd5f
--- /dev/null
+++
b/tp/tests/other/res_parser/highlight_syntax_example_default_language/chapter.html
@@ -0,0 +1,91 @@
+<!DOCTYPE html>
+<html>
+<!-- Created by texinfo, http://www.gnu.org/software/texinfo/ -->
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>chapter (top)</title>
+
+<meta name="description" content="chapter (top)">
+<meta name="keywords" content="chapter (top)">
+<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">
+
+<link href="index.html" rel="start" title="Top">
+<link href="index.html" rel="up" title="Top">
+<link href="index.html" rel="prev" title="Top">
+<style type="text/css">
+<!--
+a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
+div.example {margin-left: 3.2em}
+span:hover a.copiable-link {visibility: visible}
+-->
+</style>
+
+
+</head>
+
+<body lang="en">
+<div class="chapter-level-extent" id="chapter">
+<div class="nav-panel">
+<p>
+Previous: <a href="index.html" accesskey="p" rel="prev">top</a>, Up: <a
href="index.html" accesskey="u" rel="up">top</a> </p>
+</div>
+<hr>
+<h2 class="chapter" id="chap"><span>1 châp<a class="copiable-link"
href="#chap"> ¶</a></span></h2>
+
+<p>Texinfo
+</p><div class="example user-texinfo">
+<pre class="example-preformatted">texinfo
+<i><span style="color:#9A1900">@code{protécted}</span></i>
+</pre></div>
+
+<p>C++
+</p><div class="example user-C++">
+<pre class="example-preformatted"><i><span style="color:#9A1900">// Your First
C++ Program</span></i>
+
+<b><span style="color:#000080">#include</span></b> <span
style="color:#FF0000"><iostream></span>
+
+<span style="color:#009900">int</span> <b><span
style="color:#000000">main</span></b><span style="color:#990000">()</span>
<span style="color:#FF0000">{</span>
+ std<span style="color:#990000">::</span>cout <span
style="color:#990000"><<</span> <span style="color:#FF0000">"Hello
Wörld!"</span><span style="color:#990000">;</span>
+ <b><span style="color:#0000FF">return</span></b> <span
style="color:#993399">0</span><span style="color:#990000">;</span>
+<span style="color:#FF0000">}</span>
+</pre></div>
+
+<p>perl
+</p><div class="example user-perl">
+<pre class="example-preformatted"><b><span style="color:#0000FF">my</span></b>
<span style="color:#009900">$list</span> <span style="color:#990000">=</span>
<span style="color:#990000">[</span><span
style="color:#FF0000">'ça'</span><span style="color:#990000">,</span> <span
style="color:#FF0000">'bôù'</span><span style="color:#990000">,</span> <span
style="color:#FF0000">'é'</span><span style="color:#990000">,</span> <span
style="color:#FF0000">'é ą € ≡'</span><span style="color:#990000" [...]
+<b><span style="color:#0000FF">sub</span></b> <b><span
style="color:#0000FF">do</span></b> <span style="color:#990000">(</span>$<span
style="color:#990000">)</span> <span style="color:#FF0000">{</span>
+ <b><span style="color:#0000FF">my</span></b> <span
style="color:#009900">$arg</span> <span style="color:#990000">=</span> <b><span
style="color:#0000FF">shift</span></b><span style="color:#990000">;</span>
+ <b><span style="color:#0000FF">return</span></b> <span
style="color:#009900">$arg</span> <span style="color:#990000">+</span> <span
style="color:#993399">4</span><span style="color:#990000">;</span>
+<span style="color:#FF0000">}</span>
+</pre></div>
+
+<div class="example user-perl">
+<pre class="example-preformatted"><b><span style="color:#0000FF">my</span></b>
<span style="color:#009900">@SECTION_BUTTONS</span> <span
style="color:#990000">=</span>
+ <span style="color:#990000">(</span>
+ <span style="color:#990000">\&</span>singular_banner<span
style="color:#990000">,</span>
+ <span style="color:#FF0000">'Back'</span><span
style="color:#990000">,</span> <span
style="color:#FF0000">'Forward'</span><span style="color:#990000">,</span>
<span style="color:#FF0000">'FastBack'</span><span
style="color:#990000">,</span> <span
style="color:#FF0000">'FastForward'</span><span style="color:#990000">,</span>
+ <span style="color:#FF0000">'Up'</span><span style="color:#990000">,</span>
<span style="color:#FF0000">'Top'</span><span style="color:#990000">,</span>
<span style="color:#FF0000">'Contents'</span><span
style="color:#990000">,</span> <span style="color:#FF0000">'Index'</span><span
style="color:#990000">,</span> <span style="color:#FF0000">'About'</span>
+ <span style="color:#990000">);</span>
+
+<b><span style="color:#000000">texinfo_set_from_init_file</span></b> <span
style="color:#990000">(</span><span
style="color:#FF0000">'SECTION_BUTTONS'</span><span
style="color:#990000">,</span> <span style="color:#990000">\</span><span
style="color:#009900">@SECTION_BUTTONS</span><span
style="color:#990000">);</span>
+</pre></div>
+
+<p>No argument
+</p><div class="example">
+<pre class="example-preformatted"><b><span
style="color:#000000">texinfo_set_from_init_file</span></b><span
style="color:#990000">(</span><span style="color:#FF0000">'NO_CSS'</span><span
style="color:#990000">,</span> <span style="color:#993399">1</span><span
style="color:#990000">);</span>
+</pre></div>
+
+<p>Unknown language
+</p><div class="example user-unknown">
+<pre class="example-preformatted">unknown language
+</pre></div>
+
+</div>
+
+
+
+</body>
+</html>
diff --git
a/tp/tests/other/res_parser/highlight_syntax_example_default_language/highlight_example.1
b/tp/tests/other/res_parser/highlight_syntax_example_default_language/highlight_example.1
new file mode 100644
index 0000000000..e69de29bb2
diff --git
a/tp/tests/other/res_parser/highlight_syntax_example_default_language/highlight_example.2
b/tp/tests/other/res_parser/highlight_syntax_example_default_language/highlight_example.2
new file mode 100644
index 0000000000..e69de29bb2
diff --git
a/tp/tests/other/res_parser/highlight_syntax_example_default_language/highlight_example_highlight_C_input.C
b/tp/tests/other/res_parser/highlight_syntax_example_default_language/highlight_example_highlight_C_input.C
new file mode 100644
index 0000000000..df44306348
--- /dev/null
+++
b/tp/tests/other/res_parser/highlight_syntax_example_default_language/highlight_example_highlight_C_input.C
@@ -0,0 +1,12 @@
+Automatically generated
+
+_______________________ 0
+// Your First C++ Program
+
+#include <iostream>
+
+int main() {
+ std::cout << "Hello Wörld!";
+ return 0;
+}
+_______________________ 0
diff --git
a/tp/tests/other/res_parser/highlight_syntax_example_default_language/highlight_example_highlight_C_output.html
b/tp/tests/other/res_parser/highlight_syntax_example_default_language/highlight_example_highlight_C_output.html
new file mode 100644
index 0000000000..2abb8deadc
--- /dev/null
+++
b/tp/tests/other/res_parser/highlight_syntax_example_default_language/highlight_example_highlight_C_output.html
@@ -0,0 +1,15 @@
+<!-- Generator: GNU source-highlight
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre>_______________________________________ highlight texinfo _GT Haib0aik
zei4YieH
+<i><span style="color:#9A1900">// Your First C++ Program</span></i>
+
+<b><span style="color:#000080">#include</span></b> <span
style="color:#FF0000"><iostream></span>
+
+<span style="color:#009900">int</span> <b><span
style="color:#000000">main</span></b><span style="color:#990000">()</span>
<span style="color:#FF0000">{</span>
+ std<span style="color:#990000">::</span>cout <span
style="color:#990000"><<</span> <span style="color:#FF0000">"Hello
Wörld!"</span><span style="color:#990000">;</span>
+ <b><span style="color:#0000FF">return</span></b> <span
style="color:#993399">0</span><span style="color:#990000">;</span>
+<span style="color:#FF0000">}</span>
+_______________________________________ highlight texinfo _GT Haib0aik zei4YieH
+</pre>
diff --git
a/tp/tests/other/res_parser/highlight_syntax_example_default_language/highlight_example_highlight_perl_input.pl
b/tp/tests/other/res_parser/highlight_syntax_example_default_language/highlight_example_highlight_perl_input.pl
new file mode 100644
index 0000000000..2e343ded4b
--- /dev/null
+++
b/tp/tests/other/res_parser/highlight_syntax_example_default_language/highlight_example_highlight_perl_input.pl
@@ -0,0 +1,22 @@
+Automatically generated
+
+_______________________ 0
+my $list = ['ça', 'bôù', 'é', 'é ą € ≡'];
+sub do ($) {
+ my $arg = shift;
+ return $arg + 4;
+}
+_______________________ 0
+_______________________ 1
+my @SECTION_BUTTONS =
+ (
+ \&singular_banner,
+ 'Back', 'Forward', 'FastBack', 'FastForward',
+ 'Up', 'Top', 'Contents', 'Index', 'About'
+ );
+
+texinfo_set_from_init_file ('SECTION_BUTTONS', \@SECTION_BUTTONS);
+_______________________ 1
+_______________________ 2
+texinfo_set_from_init_file('NO_CSS', 1);
+_______________________ 2
diff --git
a/tp/tests/other/res_parser/highlight_syntax_example_default_language/highlight_example_highlight_perl_output.html
b/tp/tests/other/res_parser/highlight_syntax_example_default_language/highlight_example_highlight_perl_output.html
new file mode 100644
index 0000000000..51c59c968a
--- /dev/null
+++
b/tp/tests/other/res_parser/highlight_syntax_example_default_language/highlight_example_highlight_perl_output.html
@@ -0,0 +1,23 @@
+<!-- Generator: GNU source-highlight
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre>_______________________________________ highlight texinfo _GT Haib0aik
zei4YieH
+<b><span style="color:#0000FF">my</span></b> <span
style="color:#009900">$list</span> <span style="color:#990000">=</span> <span
style="color:#990000">[</span><span style="color:#FF0000">'ça'</span><span
style="color:#990000">,</span> <span style="color:#FF0000">'bôù'</span><span
style="color:#990000">,</span> <span style="color:#FF0000">'é'</span><span
style="color:#990000">,</span> <span style="color:#FF0000">'é ą €
≡'</span><span style="color:#990000">];</span>
+<b><span style="color:#0000FF">sub</span></b> <b><span
style="color:#0000FF">do</span></b> <span style="color:#990000">(</span>$<span
style="color:#990000">)</span> <span style="color:#FF0000">{</span>
+ <b><span style="color:#0000FF">my</span></b> <span
style="color:#009900">$arg</span> <span style="color:#990000">=</span> <b><span
style="color:#0000FF">shift</span></b><span style="color:#990000">;</span>
+ <b><span style="color:#0000FF">return</span></b> <span
style="color:#009900">$arg</span> <span style="color:#990000">+</span> <span
style="color:#993399">4</span><span style="color:#990000">;</span>
+<span style="color:#FF0000">}</span>
+_______________________________________ highlight texinfo _GT Haib0aik zei4YieH
+<b><span style="color:#0000FF">my</span></b> <span
style="color:#009900">@SECTION_BUTTONS</span> <span
style="color:#990000">=</span>
+ <span style="color:#990000">(</span>
+ <span style="color:#990000">\&</span>singular_banner<span
style="color:#990000">,</span>
+ <span style="color:#FF0000">'Back'</span><span
style="color:#990000">,</span> <span
style="color:#FF0000">'Forward'</span><span style="color:#990000">,</span>
<span style="color:#FF0000">'FastBack'</span><span
style="color:#990000">,</span> <span
style="color:#FF0000">'FastForward'</span><span style="color:#990000">,</span>
+ <span style="color:#FF0000">'Up'</span><span style="color:#990000">,</span>
<span style="color:#FF0000">'Top'</span><span style="color:#990000">,</span>
<span style="color:#FF0000">'Contents'</span><span
style="color:#990000">,</span> <span style="color:#FF0000">'Index'</span><span
style="color:#990000">,</span> <span style="color:#FF0000">'About'</span>
+ <span style="color:#990000">);</span>
+
+<b><span style="color:#000000">texinfo_set_from_init_file</span></b> <span
style="color:#990000">(</span><span
style="color:#FF0000">'SECTION_BUTTONS'</span><span
style="color:#990000">,</span> <span style="color:#990000">\</span><span
style="color:#009900">@SECTION_BUTTONS</span><span
style="color:#990000">);</span>
+_______________________________________ highlight texinfo _GT Haib0aik zei4YieH
+<b><span style="color:#000000">texinfo_set_from_init_file</span></b><span
style="color:#990000">(</span><span style="color:#FF0000">'NO_CSS'</span><span
style="color:#990000">,</span> <span style="color:#993399">1</span><span
style="color:#990000">);</span>
+_______________________________________ highlight texinfo _GT Haib0aik zei4YieH
+</pre>
diff --git
a/tp/tests/other/res_parser/highlight_syntax_example_default_language/highlight_example_highlight_texinfo_input.texi
b/tp/tests/other/res_parser/highlight_syntax_example_default_language/highlight_example_highlight_texinfo_input.texi
new file mode 100644
index 0000000000..0e10cb617b
--- /dev/null
+++
b/tp/tests/other/res_parser/highlight_syntax_example_default_language/highlight_example_highlight_texinfo_input.texi
@@ -0,0 +1,6 @@
+Automatically generated
+
+_______________________ 0
+texinfo
+@code{protécted}
+_______________________ 0
diff --git
a/tp/tests/other/res_parser/highlight_syntax_example_default_language/highlight_example_highlight_texinfo_output.html
b/tp/tests/other/res_parser/highlight_syntax_example_default_language/highlight_example_highlight_texinfo_output.html
new file mode 100644
index 0000000000..d2643de21b
--- /dev/null
+++
b/tp/tests/other/res_parser/highlight_syntax_example_default_language/highlight_example_highlight_texinfo_output.html
@@ -0,0 +1,9 @@
+<!-- Generator: GNU source-highlight
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre>_______________________________________ highlight texinfo _GT Haib0aik
zei4YieH
+texinfo
+<i><span style="color:#9A1900">@code{protécted}</span></i>
+_______________________________________ highlight texinfo _GT Haib0aik zei4YieH
+</pre>
diff --git
a/tp/tests/other/res_parser/highlight_syntax_example_default_language/index.html
b/tp/tests/other/res_parser/highlight_syntax_example_default_language/index.html
new file mode 100644
index 0000000000..7595ca942b
--- /dev/null
+++
b/tp/tests/other/res_parser/highlight_syntax_example_default_language/index.html
@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+<html>
+<!-- Created by texinfo, http://www.gnu.org/software/texinfo/ -->
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>Top (top)</title>
+
+<meta name="description" content="Top (top)">
+<meta name="keywords" content="Top (top)">
+<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">
+
+<link href="#Top" rel="start" title="Top">
+<link href="chapter.html" rel="next" title="chapter">
+<style type="text/css">
+<!--
+a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
+span:hover a.copiable-link {visibility: visible}
+-->
+</style>
+
+
+</head>
+
+<body lang="en">
+<div class="top-level-extent" id="Top">
+<div class="nav-panel">
+<p>
+Next: <a href="chapter.html" accesskey="n" rel="next">châp</a> </p>
+</div>
+<hr>
+<h1 class="top" id="top"><span>top<a class="copiable-link" href="#top">
¶</a></span></h1>
+
+<ul class="mini-toc">
+<li><a href="chapter.html" accesskey="1">châp</a></li>
+</ul>
+</div>
+<hr>
+<div class="nav-panel">
+<p>
+Next: <a href="chapter.html" accesskey="n" rel="next">châp</a> </p>
+</div>
+
+
+
+</body>
+</html>
diff --git
a/tp/tests/test_scripts/other_highlight_syntax_example_default_language.sh
b/tp/tests/test_scripts/other_highlight_syntax_example_default_language.sh
new file mode 100755
index 0000000000..bf1de8dc00
--- /dev/null
+++ b/tp/tests/test_scripts/other_highlight_syntax_example_default_language.sh
@@ -0,0 +1,25 @@
+#! /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
+
+
+
+if test "z$OTHER_TESTS" != z"yes"; then
+ echo "Skipping other tests that are not easily reproducible"
+ exit 77
+fi
+
+dir=other
+name='highlight_syntax_example_default_language'
+mkdir -p $dir
+
+"$srcdir"/run_parser_all.sh -dir $dir $name
+exit_status=$?
+cat $dir/$one_test_logs_dir/$name.log
+exit $exit_status
+