[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
texinfo/tp TODO Texinfo/Parser.pm t/60macro.t t...
From: |
Patrice Dumas |
Subject: |
texinfo/tp TODO Texinfo/Parser.pm t/60macro.t t... |
Date: |
Sat, 16 Oct 2010 11:28:38 +0000 |
CVSROOT: /sources/texinfo
Module name: texinfo
Changes by: Patrice Dumas <pertusus> 10/10/16 11:28:38
Modified files:
tp : TODO
tp/Texinfo : Parser.pm
tp/t : 60macro.t
Added files:
tp/t/results/macro: macro_no_argument.pl macro_not_closed.pl
macro_one_arg_end_of_file.pl
Log message:
Tests for @macro constructs.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/TODO?cvsroot=texinfo&r1=1.14&r2=1.15
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Parser.pm?cvsroot=texinfo&r1=1.70&r2=1.71
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/60macro.t?cvsroot=texinfo&r1=1.18&r2=1.19
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/macro/macro_no_argument.pl?cvsroot=texinfo&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/macro/macro_not_closed.pl?cvsroot=texinfo&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/macro/macro_one_arg_end_of_file.pl?cvsroot=texinfo&rev=1.1
Patches:
Index: TODO
===================================================================
RCS file: /sources/texinfo/texinfo/tp/TODO,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- TODO 16 Oct 2010 09:37:06 -0000 1.14
+++ TODO 16 Oct 2010 11:28:38 -0000 1.15
@@ -21,12 +21,6 @@
Test for @columnfractions in a random place and something like
@multitable aaa @columnfractions 0.3 0.7
-'@macro one-arg{arg}
-Arg \arg\.
address@hidden macro
-
address@hidden'
-
parse @sp a bit more.
tests in test/macros
Index: Texinfo/Parser.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Parser.pm,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -b -r1.70 -r1.71
--- Texinfo/Parser.pm 16 Oct 2010 10:11:49 -0000 1.70
+++ Texinfo/Parser.pm 16 Oct 2010 11:28:38 -0000 1.71
@@ -16,7 +16,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Original author: Patrice Dumas <address@hidden>
-# Parts come from texi2html.pl or texi2html.init.
+# Parts (also from Patrice Dumas) come from texi2html.pl or texi2html.init.
package Texinfo::Parser;
Index: t/60macro.t
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/60macro.t,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -b -r1.18 -r1.19
--- t/60macro.t 12 Oct 2010 18:06:18 -0000 1.18
+++ t/60macro.t 16 Oct 2010 11:28:38 -0000 1.19
@@ -72,6 +72,12 @@
@test1 abc
'],
+['macro_one_arg_end_of_file',
+'@macro one-arg{arg}
+Arg \arg\.
address@hidden macro
+
address@hidden'],
['too_much_args',
'@macro twoargs {first, second}
first arg: \first\
@@ -125,6 +131,12 @@
call @foo{ something
'],
+['macro_not_closed',
+'@macro name
+in macro
+'],
+['macro_no_argument',
+'@macro'],
['expand_two_same',
'@macro macro2 { arg }
With a doubles arg \arg\ and re \arg\
Index: t/results/macro/macro_no_argument.pl
===================================================================
RCS file: t/results/macro/macro_no_argument.pl
diff -N t/results/macro/macro_no_argument.pl
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ t/results/macro/macro_no_argument.pl 16 Oct 2010 11:28:38 -0000
1.1
@@ -0,0 +1,40 @@
+use vars qw(%result_texts %result_trees %result_errors);
+
+$result_trees{'macro_no_argument'} = {
+ 'contents' => [
+ {
+ 'cmdname' => 'macro',
+ 'contents' => [],
+ 'parent' => {},
+ 'special' => {
+ 'arg_line' => ''
+ }
+ }
+ ]
+};
+$result_trees{'macro_no_argument'}{'contents'}[0]{'parent'} =
$result_trees{'macro_no_argument'};
+
+$result_texts{'macro_no_argument'} = '@address@hidden macro';
+
+$result_errors{'macro_no_argument'} = [
+ {
+ 'error_line' => ':1: @macro requires a name
+',
+ 'file_name' => '',
+ 'line_nr' => 1,
+ 'macro' => '',
+ 'text' => '@macro requires a name',
+ 'type' => 'error'
+ },
+ {
+ 'error_line' => ':1: No matching address@hidden macro\'
+',
+ 'file_name' => '',
+ 'line_nr' => 1,
+ 'macro' => '',
+ 'text' => 'No matching address@hidden macro\'',
+ 'type' => 'error'
+ }
+];
+
+
Index: t/results/macro/macro_not_closed.pl
===================================================================
RCS file: t/results/macro/macro_not_closed.pl
diff -N t/results/macro/macro_not_closed.pl
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ t/results/macro/macro_not_closed.pl 16 Oct 2010 11:28:38 -0000 1.1
@@ -0,0 +1,50 @@
+use vars qw(%result_texts %result_trees %result_errors);
+
+$result_trees{'macro_not_closed'} = {
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'parent' => {},
+ 'text' => 'name',
+ 'type' => 'macro_name'
+ }
+ ],
+ 'cmdname' => 'macro',
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => 'in macro
+',
+ 'type' => 'raw'
+ }
+ ],
+ 'parent' => {},
+ 'special' => {
+ 'arg_line' => ' name
+'
+ }
+ }
+ ]
+};
+$result_trees{'macro_not_closed'}{'contents'}[0]{'args'}[0]{'parent'} =
$result_trees{'macro_not_closed'}{'contents'}[0];
+$result_trees{'macro_not_closed'}{'contents'}[0]{'contents'}[0]{'parent'} =
$result_trees{'macro_not_closed'}{'contents'}[0];
+$result_trees{'macro_not_closed'}{'contents'}[0]{'parent'} =
$result_trees{'macro_not_closed'};
+
+$result_texts{'macro_not_closed'} = '@macro name
+in macro
address@hidden macro';
+
+$result_errors{'macro_not_closed'} = [
+ {
+ 'error_line' => ':2: No matching address@hidden macro\'
+',
+ 'file_name' => '',
+ 'line_nr' => 2,
+ 'macro' => '',
+ 'text' => 'No matching address@hidden macro\'',
+ 'type' => 'error'
+ }
+];
+
+
Index: t/results/macro/macro_one_arg_end_of_file.pl
===================================================================
RCS file: t/results/macro/macro_one_arg_end_of_file.pl
diff -N t/results/macro/macro_one_arg_end_of_file.pl
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ t/results/macro/macro_one_arg_end_of_file.pl 16 Oct 2010 11:28:38
-0000 1.1
@@ -0,0 +1,79 @@
+use vars qw(%result_texts %result_trees %result_errors);
+
+$result_trees{'macro_one_arg_end_of_file'} = {
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'parent' => {},
+ 'text' => 'one-arg',
+ 'type' => 'macro_name'
+ },
+ {
+ 'parent' => {},
+ 'text' => 'arg',
+ 'type' => 'macro_arg'
+ }
+ ],
+ 'cmdname' => 'macro',
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => 'Arg \\arg\\.
+',
+ 'type' => 'raw'
+ }
+ ],
+ 'parent' => {},
+ 'special' => {
+ 'arg_line' => ' one-arg{arg}
+',
+ 'args_index' => {
+ 'arg' => 0
+ },
+ 'macrobody' => 'Arg \\arg\\.
+'
+ }
+ },
+ {
+ 'parent' => {},
+ 'text' => '
+',
+ 'type' => 'empty_line_after_command'
+ },
+ {
+ 'parent' => {},
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => 'Arg .'
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'paragraph'
+ }
+ ]
+};
+$result_trees{'macro_one_arg_end_of_file'}{'contents'}[0]{'args'}[0]{'parent'}
= $result_trees{'macro_one_arg_end_of_file'}{'contents'}[0];
+$result_trees{'macro_one_arg_end_of_file'}{'contents'}[0]{'args'}[1]{'parent'}
= $result_trees{'macro_one_arg_end_of_file'}{'contents'}[0];
+$result_trees{'macro_one_arg_end_of_file'}{'contents'}[0]{'contents'}[0]{'parent'}
= $result_trees{'macro_one_arg_end_of_file'}{'contents'}[0];
+$result_trees{'macro_one_arg_end_of_file'}{'contents'}[0]{'parent'} =
$result_trees{'macro_one_arg_end_of_file'};
+$result_trees{'macro_one_arg_end_of_file'}{'contents'}[1]{'parent'} =
$result_trees{'macro_one_arg_end_of_file'};
+$result_trees{'macro_one_arg_end_of_file'}{'contents'}[2]{'parent'} =
$result_trees{'macro_one_arg_end_of_file'};
+$result_trees{'macro_one_arg_end_of_file'}{'contents'}[3]{'contents'}[0]{'parent'}
= $result_trees{'macro_one_arg_end_of_file'}{'contents'}[3];
+$result_trees{'macro_one_arg_end_of_file'}{'contents'}[3]{'parent'} =
$result_trees{'macro_one_arg_end_of_file'};
+
+$result_texts{'macro_one_arg_end_of_file'} = '@macro one-arg{arg}
+Arg \\arg\\.
address@hidden macro
+
+Arg .';
+
+$result_errors{'macro_one_arg_end_of_file'} = [];
+
+