texinfo-commits
[Top][All Lists]
Advanced

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

texinfo/tp TODO Texinfo/Convert/Plaintext.pm t/...


From: Patrice Dumas
Subject: texinfo/tp TODO Texinfo/Convert/Plaintext.pm t/...
Date: Tue, 17 Jan 2012 23:40:07 +0000

CVSROOT:        /sources/texinfo
Module name:    texinfo
Changes by:     Patrice Dumas <pertusus>        12/01/17 23:40:07

Modified files:
        tp             : TODO 
        tp/Texinfo/Convert: Plaintext.pm 
        tp/t           : 30sectioning.t 
Added files:
        tp/t/results/sectioning: contents_with_only_top_node.pl 
                                 lone_contents.pl 

Log message:
        Test a lone @contents without any sectioning command.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/TODO?cvsroot=texinfo&r1=1.253&r2=1.254
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/Plaintext.pm?cvsroot=texinfo&r1=1.201&r2=1.202
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/30sectioning.t?cvsroot=texinfo&r1=1.71&r2=1.72
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/sectioning/contents_with_only_top_node.pl?cvsroot=texinfo&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/sectioning/lone_contents.pl?cvsroot=texinfo&rev=1.1

Patches:
Index: TODO
===================================================================
RCS file: /sources/texinfo/texinfo/tp/TODO,v
retrieving revision 1.253
retrieving revision 1.254
diff -u -b -r1.253 -r1.254
--- TODO        17 Jan 2012 23:21:00 -0000      1.253
+++ TODO        17 Jan 2012 23:40:05 -0000      1.254
@@ -66,10 +66,6 @@
 In html test empty @top for title, with different cases for 
 setcontentsaftertit* and for anchors.
 
-Tests in contents/ are incorporated?
-
-test an lone @contents without any sectioning command.
-
 Test @address@hidden and @sc{@'e} in HTML with 8bit and utf8, with and without
 enable encoding and entities.
 

Index: Texinfo/Convert/Plaintext.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Convert/Plaintext.pm,v
retrieving revision 1.201
retrieving revision 1.202
diff -u -b -r1.201 -r1.202
--- Texinfo/Convert/Plaintext.pm        7 Jan 2012 19:25:04 -0000       1.201
+++ Texinfo/Convert/Plaintext.pm        17 Jan 2012 23:40:05 -0000      1.202
@@ -832,7 +832,8 @@
 
   my $contents = 1 if ($contents_or_shortcontents eq 'contents');
 
-  #my $section = $section_root->{'section_childs'}->[0];
+  # no sections
+  return ('', 0) if (!$section_root or !$section_root->{'section_childs'});
   my $root_level = $section_root->{'section_childs'}->[0]->{'level'};
   foreach my $top_section(@{$section_root->{'section_childs'}}) {
     $root_level = $top_section->{'level'} 

Index: t/30sectioning.t
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/30sectioning.t,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -b -r1.71 -r1.72
--- t/30sectioning.t    12 Jan 2012 23:25:35 -0000      1.71
+++ t/30sectioning.t    17 Jan 2012 23:40:06 -0000      1.72
@@ -477,6 +477,15 @@
 @contents
 ', {'test_split' => 'section'}
 ],
+['lone_contents',
+'@contents
+'],
+['contents_with_only_top_node',
+'
address@hidden Top
+
address@hidden
+'],
 );
 
 my @tests_info = (

Index: t/results/sectioning/contents_with_only_top_node.pl
===================================================================
RCS file: t/results/sectioning/contents_with_only_top_node.pl
diff -N t/results/sectioning/contents_with_only_top_node.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ t/results/sectioning/contents_with_only_top_node.pl 17 Jan 2012 23:40:06 
-0000      1.1
@@ -0,0 +1,209 @@
+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);
+
+use utf8;
+
+$result_trees{'contents_with_only_top_node'} = {
+  'contents' => [
+    {
+      'contents' => [
+        {
+          'parent' => {},
+          'text' => '
+',
+          'type' => 'empty_line'
+        }
+      ],
+      'parent' => {},
+      'type' => 'text_root'
+    },
+    {
+      'args' => [
+        {
+          'contents' => [
+            {
+              'extra' => {
+                'command' => {}
+              },
+              'parent' => {},
+              'text' => ' ',
+              'type' => 'empty_spaces_after_command'
+            },
+            {
+              'parent' => {},
+              'text' => 'Top'
+            },
+            {
+              'parent' => {},
+              'text' => '
+',
+              'type' => 'spaces_at_end'
+            }
+          ],
+          'parent' => {},
+          'type' => 'misc_line_arg'
+        }
+      ],
+      'cmdname' => 'node',
+      'contents' => [
+        {
+          'parent' => {},
+          'text' => '
+',
+          'type' => 'empty_line'
+        },
+        {
+          'cmdname' => 'contents',
+          'parent' => {}
+        }
+      ],
+      'extra' => {
+        'node_content' => [
+          {}
+        ],
+        'nodes_manuals' => [
+          {
+            'node_content' => [],
+            'normalized' => 'Top'
+          }
+        ],
+        'normalized' => 'Top'
+      },
+      'line_nr' => {
+        'file_name' => '',
+        'line_nr' => 2,
+        'macro' => ''
+      },
+      'parent' => {}
+    }
+  ],
+  'type' => 'document_root'
+};
+$result_trees{'contents_with_only_top_node'}{'contents'}[0]{'contents'}[0]{'parent'}
 = $result_trees{'contents_with_only_top_node'}{'contents'}[0];
+$result_trees{'contents_with_only_top_node'}{'contents'}[0]{'parent'} = 
$result_trees{'contents_with_only_top_node'};
+$result_trees{'contents_with_only_top_node'}{'contents'}[1]{'args'}[0]{'contents'}[0]{'extra'}{'command'}
 = $result_trees{'contents_with_only_top_node'}{'contents'}[1];
+$result_trees{'contents_with_only_top_node'}{'contents'}[1]{'args'}[0]{'contents'}[0]{'parent'}
 = $result_trees{'contents_with_only_top_node'}{'contents'}[1]{'args'}[0];
+$result_trees{'contents_with_only_top_node'}{'contents'}[1]{'args'}[0]{'contents'}[1]{'parent'}
 = $result_trees{'contents_with_only_top_node'}{'contents'}[1]{'args'}[0];
+$result_trees{'contents_with_only_top_node'}{'contents'}[1]{'args'}[0]{'contents'}[2]{'parent'}
 = $result_trees{'contents_with_only_top_node'}{'contents'}[1]{'args'}[0];
+$result_trees{'contents_with_only_top_node'}{'contents'}[1]{'args'}[0]{'parent'}
 = $result_trees{'contents_with_only_top_node'}{'contents'}[1];
+$result_trees{'contents_with_only_top_node'}{'contents'}[1]{'contents'}[0]{'parent'}
 = $result_trees{'contents_with_only_top_node'}{'contents'}[1];
+$result_trees{'contents_with_only_top_node'}{'contents'}[1]{'contents'}[1]{'parent'}
 = $result_trees{'contents_with_only_top_node'}{'contents'}[1];
+$result_trees{'contents_with_only_top_node'}{'contents'}[1]{'extra'}{'node_content'}[0]
 = 
$result_trees{'contents_with_only_top_node'}{'contents'}[1]{'args'}[0]{'contents'}[1];
+$result_trees{'contents_with_only_top_node'}{'contents'}[1]{'extra'}{'nodes_manuals'}[0]{'node_content'}
 = 
$result_trees{'contents_with_only_top_node'}{'contents'}[1]{'extra'}{'node_content'};
+$result_trees{'contents_with_only_top_node'}{'contents'}[1]{'parent'} = 
$result_trees{'contents_with_only_top_node'};
+
+$result_texis{'contents_with_only_top_node'} = '
address@hidden Top
+
address@hidden
+';
+
+
+$result_texts{'contents_with_only_top_node'} = '
+
+';
+
+$result_sectioning{'contents_with_only_top_node'} = {};
+
+$result_nodes{'contents_with_only_top_node'} = {
+  'cmdname' => 'node',
+  'extra' => {
+    'normalized' => 'Top'
+  },
+  'node_up' => {
+    'extra' => {
+      'manual_content' => [
+        {
+          'text' => 'dir'
+        }
+      ],
+      'top_node_up' => {}
+    },
+    'type' => 'top_node_up'
+  }
+};
+$result_nodes{'contents_with_only_top_node'}{'node_up'}{'extra'}{'top_node_up'}
 = $result_nodes{'contents_with_only_top_node'};
+
+$result_menus{'contents_with_only_top_node'} = {
+  'cmdname' => 'node',
+  'extra' => {
+    'normalized' => 'Top'
+  }
+};
+
+$result_errors{'contents_with_only_top_node'} = [];
+
+
+
+$result_converted{'plaintext'}->{'contents_with_only_top_node'} = '';
+
+
+$result_converted{'html'}->{'contents_with_only_top_node'} = '<!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>
+<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="Generator" content="tp">
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<link href="#Top" rel="start" title="Top">
+<style type="text/css">
+<!--
+a.summary-letter {text-decoration: none}
+blockquote.smallquotation {font-size: smaller}
+div.display {margin-left: 3.2em}
+div.example {margin-left: 3.2em}
+div.lisp {margin-left: 3.2em}
+div.smalldisplay {margin-left: 3.2em}
+div.smallexample {margin-left: 3.2em}
+div.smalllisp {margin-left: 3.2em}
+pre.display {font-family: serif}
+pre.format {font-family: serif}
+pre.menu-comment {font-family: serif}
+pre.menu-preformatted {font-family: serif}
+pre.smalldisplay {font-family: serif; font-size: smaller}
+pre.smallexample {font-size: smaller}
+pre.smallformat {font-family: serif; font-size: smaller}
+pre.smalllisp {font-size: smaller}
+span.nocodebreak {white-space:pre}
+span.nolinebreak {white-space:pre}
+span.roman {font-family:serif; font-weight:normal}
+span.sansserif {font-family:sans-serif; font-weight:normal}
+ul.no-bullet {list-style: none}
+-->
+</style>
+
+
+</head>
+
+<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" 
vlink="#800080" alink="#FF0000">
+
+<a name="Top"></a>
+<h1 class="node-heading">Top</h1>
+
+<hr>
+<p>
+
+
+</p>
+</body>
+</html>
+';
+
+$result_converted_errors{'html'}->{'contents_with_only_top_node'} = [
+  {
+    'error_line' => 'warning: Must specify a title with a title command or @top
+',
+    'text' => 'Must specify a title with a title command or @top',
+    'type' => 'warning'
+  }
+];
+
+
+1;

Index: t/results/sectioning/lone_contents.pl
===================================================================
RCS file: t/results/sectioning/lone_contents.pl
diff -N t/results/sectioning/lone_contents.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ t/results/sectioning/lone_contents.pl       17 Jan 2012 23:40:06 -0000      
1.1
@@ -0,0 +1,92 @@
+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);
+
+use utf8;
+
+$result_trees{'lone_contents'} = {
+  'contents' => [
+    {
+      'cmdname' => 'contents',
+      'parent' => {}
+    }
+  ],
+  'type' => 'text_root'
+};
+$result_trees{'lone_contents'}{'contents'}[0]{'parent'} = 
$result_trees{'lone_contents'};
+
+$result_texis{'lone_contents'} = '@contents
+';
+
+
+$result_texts{'lone_contents'} = '';
+
+$result_errors{'lone_contents'} = [];
+
+
+
+$result_converted{'plaintext'}->{'lone_contents'} = '';
+
+
+$result_converted{'html'}->{'lone_contents'} = '<!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>
+<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="Generator" content="tp">
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<style type="text/css">
+<!--
+a.summary-letter {text-decoration: none}
+blockquote.smallquotation {font-size: smaller}
+div.display {margin-left: 3.2em}
+div.example {margin-left: 3.2em}
+div.lisp {margin-left: 3.2em}
+div.smalldisplay {margin-left: 3.2em}
+div.smallexample {margin-left: 3.2em}
+div.smalllisp {margin-left: 3.2em}
+pre.display {font-family: serif}
+pre.format {font-family: serif}
+pre.menu-comment {font-family: serif}
+pre.menu-preformatted {font-family: serif}
+pre.smalldisplay {font-family: serif; font-size: smaller}
+pre.smallexample {font-size: smaller}
+pre.smallformat {font-family: serif; font-size: smaller}
+pre.smalllisp {font-size: smaller}
+span.nocodebreak {white-space:pre}
+span.nolinebreak {white-space:pre}
+span.roman {font-family:serif; font-weight:normal}
+span.sansserif {font-family:sans-serif; font-weight:normal}
+ul.no-bullet {list-style: none}
+-->
+</style>
+
+
+</head>
+
+<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" 
vlink="#800080" alink="#FF0000">
+<p>
+
+
+</p>
+</body>
+</html>
+';
+
+$result_converted_errors{'html'}->{'lone_contents'} = [
+  {
+    'error_line' => 'warning: Must specify a title with a title command or @top
+',
+    'text' => 'Must specify a title with a title command or @top',
+    'type' => 'warning'
+  }
+];
+
+
+1;



reply via email to

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