[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: * tp/Makefile.am (test_files), tp/t/init/test_css
From: |
Patrice Dumas |
Subject: |
branch master updated: * tp/Makefile.am (test_files), tp/t/init/test_css_info_functions.pm, tp/Makefile.tres, tp/t/html_tests.t (base_for_css_info_in_init_test) (text_css_info_in_init): add text_css_info_in_init, a test of css_add_info and css_set_selector_style use, and a test without the init file used, base_for_css_info_in_init_test, for comparison. |
Date: |
Sat, 06 Jan 2024 12:54:16 -0500 |
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 2c9bbf42a1 * tp/Makefile.am (test_files),
tp/t/init/test_css_info_functions.pm, tp/Makefile.tres, tp/t/html_tests.t
(base_for_css_info_in_init_test) (text_css_info_in_init): add
text_css_info_in_init, a test of css_add_info and css_set_selector_style use,
and a test without the init file used, base_for_css_info_in_init_test, for
comparison.
2c9bbf42a1 is described below
commit 2c9bbf42a1afcdb79c07e1ca5a605e51c5e02fef
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sat Jan 6 18:54:15 2024 +0100
* tp/Makefile.am (test_files), tp/t/init/test_css_info_functions.pm,
tp/Makefile.tres, tp/t/html_tests.t (base_for_css_info_in_init_test)
(text_css_info_in_init): add text_css_info_in_init, a test of
css_add_info and css_set_selector_style use, and a test without the
init file used, base_for_css_info_in_init_test, for comparison.
---
ChangeLog | 8 +
tp/Makefile.am | 1 +
tp/Makefile.tres | 4 +
tp/TODO | 4 -
tp/t/html_tests.t | 14 ++
tp/t/init/css_in_node_redirection_page.pm | 3 -
tp/t/init/test_css_info_functions.pm | 21 ++
.../html_tests/base_for_css_info_in_init_test.pl | 252 +++++++++++++++++++++
.../res_html/index.html | 41 ++++
tp/t/results/html_tests/text_css_info_in_init.pl | 252 +++++++++++++++++++++
.../text_css_info_in_init/res_html/index.html | 43 ++++
11 files changed, 636 insertions(+), 7 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index e73669fbfb..3993b8953a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2024-01-06 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Makefile.am (test_files), tp/t/init/test_css_info_functions.pm,
+ tp/Makefile.tres, tp/t/html_tests.t (base_for_css_info_in_init_test)
+ (text_css_info_in_init): add text_css_info_in_init, a test of
+ css_add_info and css_set_selector_style use, and a test without the
+ init file used, base_for_css_info_in_init_test, for comparison.
+
2024-01-06 Patrice Dumas <pertusus@free.fr>
* doc/texi2any_api.texi (Simple Customization of CSS),
diff --git a/tp/Makefile.am b/tp/Makefile.am
index eb1114906e..4c43daf7d5 100644
--- a/tp/Makefile.am
+++ b/tp/Makefile.am
@@ -186,6 +186,7 @@ test_files = \
t/init/redirection_file_collision_with_user_def.init \
t/init/special_element_customization.pm \
t/init/t2h_singular.init \
+ t/init/test_css_info_functions.pm \
t/init/test_directions.init \
t/init/test_renamed_nodes.init \
t/init/translate_txiinternalvalue_macro.init \
diff --git a/tp/Makefile.tres b/tp/Makefile.tres
index 793e82fc7b..82936a1bac 100644
--- a/tp/Makefile.tres
+++ b/tp/Makefile.tres
@@ -542,6 +542,8 @@ test_files_generated_list =
$(test_tap_files_generated_list) \
t/results/heading/heading_in_quotation.pl \
t/results/html_tests/acronym_in_node_and_section.pl \
t/results/html_tests/automatic_menus.pl \
+ t/results/html_tests/base_for_css_info_in_init_test.pl \
+ t/results/html_tests/base_for_css_info_in_init_test/res_html \
t/results/html_tests/character_number_leading_toc_stoc.pl \
t/results/html_tests/check_htmlxref.pl \
t/results/html_tests/check_htmlxref_ignore_ref_top_up.pl \
@@ -713,6 +715,8 @@ test_files_generated_list =
$(test_tap_files_generated_list) \
t/results/html_tests/tex_expanded_in_copying.pl \
t/results/html_tests/text_before_top_and_contents_after_title.pl \
t/results/html_tests/text_before_top_and_summarycontents_after_title.pl \
+ t/results/html_tests/text_css_info_in_init.pl \
+ t/results/html_tests/text_css_info_in_init/res_html \
t/results/html_tests/titles.pl \
t/results/html_tests/top_file_name_and_node_name_collision.pl \
t/results/html_tests/top_file_name_and_node_name_collision/res_html \
diff --git a/tp/TODO b/tp/TODO
index f9799da2c9..6bfa458270 100644
--- a/tp/TODO
+++ b/tp/TODO
@@ -10,10 +10,6 @@ This is the todo list for texi2any
Before next release
===================
-add test of init css_add_info
- $converter->css_set_selector_style('h1.titlefont', 'text-align:center');
-and css_set_selector_style for a selector already set
-
Do a test that shows that accessing directly css_element_class_styles
in perl in _collect_css_element_class and html_attribute_class is problematic
with some perl/C mixing case.
diff --git a/tp/t/html_tests.t b/tp/t/html_tests.t
index 599ca0e823..e27e6ac78e 100644
--- a/tp/t/html_tests.t
+++ b/tp/t/html_tests.t
@@ -870,6 +870,16 @@ undef, {'test_file' =>
'punctuation_small_case_accents_us_ascii.texi',
{'OUTPUT_CHARACTERS' => 1, 'OUTPUT_ENCODING_NAME' => 'utf-8'}],
);
+my $css_init_file_texinfo = '@node Top
+@top top
+
+@sansserif{SSSSSSSSSSs ssss}.
+
+@code{@r{in r in code}}
+
+@titlefont{in a new heading}
+';
+
# test that the node name that goes in the redirection file is reproducible.
my @file_tests = (
['redirection_same_labels',
@@ -1281,6 +1291,10 @@ $info_js_dir_test, {}, {'INFO_JS_DIR' => 'js'}],
@sansserif{SANS}.
@anchor{spot}
', {'init_files' => ['css_in_node_redirection_page.pm']}],
+['base_for_css_info_in_init_test',
+$css_init_file_texinfo,],
+['text_css_info_in_init',
+$css_init_file_texinfo, {'init_files' => ['test_css_info_functions.pm']}],
);
diff --git a/tp/t/init/css_in_node_redirection_page.pm
b/tp/t/init/css_in_node_redirection_page.pm
index 3a21204a9f..787f3b48e8 100644
--- a/tp/t/init/css_in_node_redirection_page.pm
+++ b/tp/t/init/css_in_node_redirection_page.pm
@@ -1,6 +1,3 @@
-
-use utf8;
-
package Texinfo::Config;
use strict;
diff --git a/tp/t/init/test_css_info_functions.pm
b/tp/t/init/test_css_info_functions.pm
new file mode 100644
index 0000000000..a830836db0
--- /dev/null
+++ b/tp/t/init/test_css_info_functions.pm
@@ -0,0 +1,21 @@
+package Texinfo::Config;
+
+use strict;
+
+sub _texi2any_tests_test_css_info_functions {
+ my $converter = shift;
+
+ $converter->css_add_info('imports', '@import something');
+
+ $converter->css_add_info('rules', 'a rule');
+
+ $converter->css_set_selector_style('h1.titlefont', 'text-align:center');
+
+ $converter->css_set_selector_style('span.sansserif', 'font-style: oblique');
+
+ $converter->css_set_selector_style('span.r', undef);
+
+ return 0;
+}
+
+texinfo_register_handler('setup', \&_texi2any_tests_test_css_info_functions);
diff --git a/tp/t/results/html_tests/base_for_css_info_in_init_test.pl
b/tp/t/results/html_tests/base_for_css_info_in_init_test.pl
new file mode 100644
index 0000000000..1207cdbc7e
--- /dev/null
+++ b/tp/t/results/html_tests/base_for_css_info_in_init_test.pl
@@ -0,0 +1,252 @@
+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{'base_for_css_info_in_init_test'} = {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'type' => 'preamble_before_content'
+ }
+ ],
+ 'type' => 'before_node_section'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'Top'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'is_target' => 1,
+ 'normalized' => 'Top'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'line_nr' => 1
+ }
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'top'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'top',
+ 'contents' => [
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'SSSSSSSSSSs ssss'
+ }
+ ],
+ 'type' => 'brace_command_arg'
+ }
+ ],
+ 'cmdname' => 'sansserif',
+ 'source_info' => {
+ 'line_nr' => 4
+ }
+ },
+ {
+ 'text' => '.
+'
+ }
+ ],
+ 'type' => 'paragraph'
+ },
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'in r in code'
+ }
+ ],
+ 'type' => 'brace_command_arg'
+ }
+ ],
+ 'cmdname' => 'r',
+ 'source_info' => {
+ 'line_nr' => 6
+ }
+ }
+ ],
+ 'type' => 'brace_command_arg'
+ }
+ ],
+ 'cmdname' => 'code',
+ 'source_info' => {
+ 'line_nr' => 6
+ }
+ },
+ {
+ 'text' => '
+'
+ }
+ ],
+ 'type' => 'paragraph'
+ },
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'in a new heading'
+ }
+ ],
+ 'type' => 'brace_command_arg'
+ }
+ ],
+ 'cmdname' => 'titlefont',
+ 'extra' => {},
+ 'source_info' => {
+ 'line_nr' => 8
+ }
+ },
+ {
+ 'text' => '
+'
+ }
+ ],
+ 'extra' => {},
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'line_nr' => 2
+ }
+ }
+ ],
+ 'type' => 'document_root'
+};
+
+$result_texis{'base_for_css_info_in_init_test'} = '@node Top
+@top top
+
+@sansserif{SSSSSSSSSSs ssss}.
+
+@code{@r{in r in code}}
+
+@titlefont{in a new heading}
+';
+
+
+$result_texts{'base_for_css_info_in_init_test'} = 'top
+***
+
+SSSSSSSSSSs ssss.
+
+in r in code
+
+in a new heading
+';
+
+$result_sectioning{'base_for_css_info_in_init_test'} = {
+ 'extra' => {
+ 'section_childs' => [
+ {
+ 'cmdname' => 'top',
+ 'extra' => {
+ 'associated_node' => {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'normalized' => 'Top'
+ }
+ },
+ 'section_level' => 0,
+ 'sectioning_root' => {}
+ }
+ }
+ ],
+ 'section_level' => -1
+ }
+};
+$result_sectioning{'base_for_css_info_in_init_test'}{'extra'}{'section_childs'}[0]{'extra'}{'sectioning_root'}
= $result_sectioning{'base_for_css_info_in_init_test'};
+
+$result_nodes{'base_for_css_info_in_init_test'} = [
+ {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'associated_section' => {
+ 'cmdname' => 'top',
+ 'extra' => {}
+ },
+ 'normalized' => 'Top'
+ }
+ }
+];
+
+$result_menus{'base_for_css_info_in_init_test'} = [
+ {
+ 'extra' => {
+ 'normalized' => 'Top'
+ }
+ }
+];
+
+$result_errors{'base_for_css_info_in_init_test'} = [];
+
+
+$result_floats{'base_for_css_info_in_init_test'} = {};
+
+
+1;
diff --git
a/tp/t/results/html_tests/base_for_css_info_in_init_test/res_html/index.html
b/tp/t/results/html_tests/base_for_css_info_in_init_test/res_html/index.html
new file mode 100644
index 0000000000..f22d028507
--- /dev/null
+++ b/tp/t/results/html_tests/base_for_css_info_in_init_test/res_html/index.html
@@ -0,0 +1,41 @@
+<!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="viewport" content="width=device-width,initial-scale=1">
+
+<link href="#Top" rel="start" title="Top">
+<style type="text/css">
+<!--
+a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
+span.r {font-family: initial; font-weight: normal; font-style: normal}
+span.sansserif {font-family: sans-serif; font-weight: normal}
+span:hover a.copiable-link {visibility: visible}
+-->
+</style>
+
+
+</head>
+
+<body lang="en">
+<div class="top-level-extent" id="Top">
+<h1 class="top" id="top"><span>top<a class="copiable-link" href="#top">
¶</a></span></h1>
+
+<p><span class="sansserif">SSSSSSSSSSs ssss</span>.
+</p>
+<p><code class="code"><span class="r">in r in code</span></code>
+</p>
+<h1 class="titlefont">in a new heading</h1>
+</div>
+
+
+
+</body>
+</html>
diff --git a/tp/t/results/html_tests/text_css_info_in_init.pl
b/tp/t/results/html_tests/text_css_info_in_init.pl
new file mode 100644
index 0000000000..1d7ce0a536
--- /dev/null
+++ b/tp/t/results/html_tests/text_css_info_in_init.pl
@@ -0,0 +1,252 @@
+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{'text_css_info_in_init'} = {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'type' => 'preamble_before_content'
+ }
+ ],
+ 'type' => 'before_node_section'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'Top'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'is_target' => 1,
+ 'normalized' => 'Top'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'line_nr' => 1
+ }
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'top'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'top',
+ 'contents' => [
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'SSSSSSSSSSs ssss'
+ }
+ ],
+ 'type' => 'brace_command_arg'
+ }
+ ],
+ 'cmdname' => 'sansserif',
+ 'source_info' => {
+ 'line_nr' => 4
+ }
+ },
+ {
+ 'text' => '.
+'
+ }
+ ],
+ 'type' => 'paragraph'
+ },
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'in r in code'
+ }
+ ],
+ 'type' => 'brace_command_arg'
+ }
+ ],
+ 'cmdname' => 'r',
+ 'source_info' => {
+ 'line_nr' => 6
+ }
+ }
+ ],
+ 'type' => 'brace_command_arg'
+ }
+ ],
+ 'cmdname' => 'code',
+ 'source_info' => {
+ 'line_nr' => 6
+ }
+ },
+ {
+ 'text' => '
+'
+ }
+ ],
+ 'type' => 'paragraph'
+ },
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'in a new heading'
+ }
+ ],
+ 'type' => 'brace_command_arg'
+ }
+ ],
+ 'cmdname' => 'titlefont',
+ 'extra' => {},
+ 'source_info' => {
+ 'line_nr' => 8
+ }
+ },
+ {
+ 'text' => '
+'
+ }
+ ],
+ 'extra' => {},
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'line_nr' => 2
+ }
+ }
+ ],
+ 'type' => 'document_root'
+};
+
+$result_texis{'text_css_info_in_init'} = '@node Top
+@top top
+
+@sansserif{SSSSSSSSSSs ssss}.
+
+@code{@r{in r in code}}
+
+@titlefont{in a new heading}
+';
+
+
+$result_texts{'text_css_info_in_init'} = 'top
+***
+
+SSSSSSSSSSs ssss.
+
+in r in code
+
+in a new heading
+';
+
+$result_sectioning{'text_css_info_in_init'} = {
+ 'extra' => {
+ 'section_childs' => [
+ {
+ 'cmdname' => 'top',
+ 'extra' => {
+ 'associated_node' => {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'normalized' => 'Top'
+ }
+ },
+ 'section_level' => 0,
+ 'sectioning_root' => {}
+ }
+ }
+ ],
+ 'section_level' => -1
+ }
+};
+$result_sectioning{'text_css_info_in_init'}{'extra'}{'section_childs'}[0]{'extra'}{'sectioning_root'}
= $result_sectioning{'text_css_info_in_init'};
+
+$result_nodes{'text_css_info_in_init'} = [
+ {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'associated_section' => {
+ 'cmdname' => 'top',
+ 'extra' => {}
+ },
+ 'normalized' => 'Top'
+ }
+ }
+];
+
+$result_menus{'text_css_info_in_init'} = [
+ {
+ 'extra' => {
+ 'normalized' => 'Top'
+ }
+ }
+];
+
+$result_errors{'text_css_info_in_init'} = [];
+
+
+$result_floats{'text_css_info_in_init'} = {};
+
+
+1;
diff --git a/tp/t/results/html_tests/text_css_info_in_init/res_html/index.html
b/tp/t/results/html_tests/text_css_info_in_init/res_html/index.html
new file mode 100644
index 0000000000..4a78f55aa0
--- /dev/null
+++ b/tp/t/results/html_tests/text_css_info_in_init/res_html/index.html
@@ -0,0 +1,43 @@
+<!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="viewport" content="width=device-width,initial-scale=1">
+
+<link href="#Top" rel="start" title="Top">
+<style type="text/css">
+<!--
+@import something
+a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
+h1.titlefont {text-align:center}
+span.sansserif {font-style: oblique}
+span:hover a.copiable-link {visibility: visible}
+a rule
+-->
+</style>
+
+
+</head>
+
+<body lang="en">
+<div class="top-level-extent" id="Top">
+<h1 class="top" id="top"><span>top<a class="copiable-link" href="#top">
¶</a></span></h1>
+
+<p><span class="sansserif">SSSSSSSSSSs ssss</span>.
+</p>
+<p><code class="code"><span class="r">in r in code</span></code>
+</p>
+<h1 class="titlefont">in a new heading</h1>
+</div>
+
+
+
+</body>
+</html>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: * tp/Makefile.am (test_files), tp/t/init/test_css_info_functions.pm, tp/Makefile.tres, tp/t/html_tests.t (base_for_css_info_in_init_test) (text_css_info_in_init): add text_css_info_in_init, a test of css_add_info and css_set_selector_style use, and a test without the init file used, base_for_css_info_in_init_test, for comparison.,
Patrice Dumas <=