[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
texinfo/tp Texinfo/Parser.pm Texinfo/Convert/Pl...
From: |
Patrice Dumas |
Subject: |
texinfo/tp Texinfo/Parser.pm Texinfo/Convert/Pl... |
Date: |
Tue, 07 Dec 2010 23:18:30 +0000 |
CVSROOT: /sources/texinfo
Module name: texinfo
Changes by: Patrice Dumas <pertusus> 10/12/07 23:18:30
Modified files:
tp/Texinfo : Parser.pm
tp/Texinfo/Convert: Plaintext.pm
tp/t : test_utils.pl
tp/t/results/coverage_braces: space_in_image.pl
tp/t/results/paragraph: no_paragraph_commands.pl
Added files:
tp/t/include : a.txt aa.txt f.txt
Log message:
Add converter errors to the test suite checks.
Test and Fix @image handling.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Parser.pm?cvsroot=texinfo&r1=1.166&r2=1.167
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/Plaintext.pm?cvsroot=texinfo&r1=1.30&r2=1.31
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/test_utils.pl?cvsroot=texinfo&r1=1.59&r2=1.60
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/include/a.txt?cvsroot=texinfo&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/include/aa.txt?cvsroot=texinfo&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/include/f.txt?cvsroot=texinfo&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/coverage_braces/space_in_image.pl?cvsroot=texinfo&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/paragraph/no_paragraph_commands.pl?cvsroot=texinfo&r1=1.17&r2=1.18
Patches:
Index: Texinfo/Parser.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Parser.pm,v
retrieving revision 1.166
retrieving revision 1.167
diff -u -b -r1.166 -r1.167
--- Texinfo/Parser.pm 7 Dec 2010 10:10:51 -0000 1.166
+++ Texinfo/Parser.pm 7 Dec 2010 23:18:30 -0000 1.167
@@ -1683,6 +1683,8 @@
my $self = shift;
my $text = shift;
my $file;
+
+ #print STDERR "$self $text @{$self->{'include_directories'}}\n";
if ($text =~ m,^(/|\./|\.\./),) {
$file = $text if (-e $text and -r $text);
} else {
Index: Texinfo/Convert/Plaintext.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Convert/Plaintext.pm,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -b -r1.30 -r1.31
--- Texinfo/Convert/Plaintext.pm 7 Dec 2010 10:10:51 -0000 1.30
+++ Texinfo/Convert/Plaintext.pm 7 Dec 2010 23:18:30 -0000 1.31
@@ -752,7 +752,7 @@
my $basefile = Texinfo::Convert::Text::convert(
{'contents' => $root->{'extra'}->{'brace_command_contents'}->[0]});
my $txt_file =
- $self->Texinfo::Parser::_locate_include_file ($self,
$basefile.'.txt');
+ $self->Texinfo::Parser::_locate_include_file ($basefile.'.txt');
if (!defined($txt_file)) {
$self->line_warn(sprintf($self->__("Cannot find address@hidden file
`%s.txt'"), $basefile), $root->{'line_nr'});
} else {
Index: t/test_utils.pl
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/test_utils.pl,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -b -r1.59 -r1.60
--- t/test_utils.pl 7 Dec 2010 20:34:27 -0000 1.59
+++ t/test_utils.pl 7 Dec 2010 23:18:30 -0000 1.60
@@ -179,7 +179,7 @@
Texinfo::Convert::Plaintext::converter({'debug' => $self->{'debug'},
'parser' => $parser });
my $result = $converter->convert($tree);
- my ($errors, $error_nrs) = $parser->errors();
+ my ($errors, $error_nrs) = $converter->errors();
return ($errors, $result);
}
@@ -242,10 +242,12 @@
my $converted_text = Texinfo::Convert::Text::convert($result);
my %converted;
+ my %converted_errors;
foreach my $format (@tested_formats) {
if (defined($formats{$format})) {
- ($result_converted_errors{$format}, $converted{$format})
+ ($converted_errors{$format}, $converted{$format})
= &{$formats{$format}}($self, $result, $parser);
+ $converted_errors{$format} = undef if (address@hidden);
#print STDERR "$format: \n$converted{$format}";
}
}
@@ -309,9 +311,10 @@
.$test_name.'\'} =
\''.protect_perl_string($converted{$format})."';\n\n";
#print STDERR "$format: \n$converted{$format}";
}
- if (defined($result_converted_errors{$format})) {
- # $out_result .=
Data::Dumper->Dump([$result_converted_errors{$format}],
- #
['$result_converted_errors\''.$format.'\'}->{\''.$test_name.'\'}']) ."\n\n";
+ if (defined($converted_errors{$format})) {
+ $out_result .= Data::Dumper->Dump([$converted_errors{$format}],
+
['$result_converted_errors\''.$format.'\'}->{\''.$test_name.'\'}']) ."\n\n";
+ #print STDERR "".Data::Dumper->Dump([$converted_errors{$format}]);
}
}
@@ -387,9 +390,12 @@
if (!defined($result_converted{$format})) {
print STDERR "\n$format $test_name:\n$converted{$format}";
} else {
- $tests_count++;
+ $tests_count += 2;
ok ($converted{$format} eq $result_converted{$format}->{$test_name},
$test_name.' converted '.$format);
+ ok (Data::Compare::Compare($converted_errors{$format},
+ $result_converted_errors{$format}->{$test_name}),
+ $test_name.' errors '.$format);
}
#print STDERR "$format: \n$converted{$format}";
}
Index: t/results/coverage_braces/space_in_image.pl
===================================================================
RCS file:
/sources/texinfo/texinfo/tp/t/results/coverage_braces/space_in_image.pl,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- t/results/coverage_braces/space_in_image.pl 7 Dec 2010 20:34:28 -0000
1.12
+++ t/results/coverage_braces/space_in_image.pl 7 Dec 2010 23:18:30 -0000
1.13
@@ -197,7 +197,9 @@
-$result_converted{'plaintext'}->{'space_in_image'} = '. .
+$result_converted{'plaintext'}->{'space_in_image'} = 'An image text before
paragraph.
+.[Another image text, in paragraph.
+] .
';
1;
Index: t/results/paragraph/no_paragraph_commands.pl
===================================================================
RCS file:
/sources/texinfo/texinfo/tp/t/results/paragraph/no_paragraph_commands.pl,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -b -r1.17 -r1.18
--- t/results/paragraph/no_paragraph_commands.pl 7 Dec 2010 20:34:31
-0000 1.17
+++ t/results/paragraph/no_paragraph_commands.pl 7 Dec 2010 23:18:30
-0000 1.18
@@ -180,6 +180,7 @@
$result_converted{'plaintext'}->{'no_paragraph_commands'} = '
title font
**********
+Text for image out of paragraph.
';
1;
Index: t/include/a.txt
===================================================================
RCS file: t/include/a.txt
diff -N t/include/a.txt
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ t/include/a.txt 7 Dec 2010 23:18:30 -0000 1.1
@@ -0,0 +1 @@
+An image text before paragraph.
Index: t/include/aa.txt
===================================================================
RCS file: t/include/aa.txt
diff -N t/include/aa.txt
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ t/include/aa.txt 7 Dec 2010 23:18:30 -0000 1.1
@@ -0,0 +1 @@
+Text for image out of paragraph.
Index: t/include/f.txt
===================================================================
RCS file: t/include/f.txt
diff -N t/include/f.txt
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ t/include/f.txt 7 Dec 2010 23:18:30 -0000 1.1
@@ -0,0 +1 @@
+Another image text, in paragraph.