[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
texinfo/tp Texinfo/Convert/Plaintext.pm t/test_...
From: |
Patrice Dumas |
Subject: |
texinfo/tp Texinfo/Convert/Plaintext.pm t/test_... |
Date: |
Sat, 20 Nov 2010 17:26:51 +0000 |
CVSROOT: /sources/texinfo
Module name: texinfo
Changes by: Patrice Dumas <pertusus> 10/11/20 17:26:51
Modified files:
tp/Texinfo/Convert: Plaintext.pm
tp/t : test_utils.pl
Log message:
Compare convnersion result with reference.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/Plaintext.pm?cvsroot=texinfo&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/test_utils.pl?cvsroot=texinfo&r1=1.54&r2=1.55
Patches:
Index: Texinfo/Convert/Plaintext.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Convert/Plaintext.pm,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- Texinfo/Convert/Plaintext.pm 20 Nov 2010 16:44:30 -0000 1.5
+++ Texinfo/Convert/Plaintext.pm 20 Nov 2010 17:26:51 -0000 1.6
@@ -759,7 +759,7 @@
pop @{$self->{'context'}};
}
pop @{$self->{'format_context'}}
- if ($indented_commands{$root->{'cmdname'}});
+ if ($root->{'cmdname'} and $indented_commands{$root->{'cmdname'}});
return $result;
}
Index: t/test_utils.pl
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/test_utils.pl,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -b -r1.54 -r1.55
--- t/test_utils.pl 20 Nov 2010 17:05:40 -0000 1.54
+++ t/test_utils.pl 20 Nov 2010 17:26:51 -0000 1.55
@@ -186,6 +186,8 @@
my $parser_options = {};
my ($test_name, $test_text);
+ my $tests_count = 0;
+
if (ref($test_case) eq 'ARRAY') {
$test_name = shift @$test_case;
$test_text = shift @$test_case;
@@ -366,9 +368,19 @@
ok (Texinfo::Convert::Texinfo::convert($result) eq
$result_texis{$test_name},
$test_name.' texi');
ok ($converted_text eq $result_texts{$test_name}, $test_name.' text');
+ $tests_count = $nr_comparisons;
+ if (@tested_formats) {
+ foreach my $format (keys(%result_converted)) {
+ $tests_count++;
+ ok ($converted{$format} eq $result_converted{$format}->{$test_name},
+ $test_name.' converted '.$format);
+ #print STDERR "$format: \n$converted{$format}";
+ }
+ }
#is (Texinfo::Convert::Texinfo::convert($result),
$result_texis{$test_name}, $test_name.' text');
}
#exit;
+ return $tests_count;
}
sub run_all($$;$$$)
@@ -391,17 +403,19 @@
}
}
+ my $test_nrs = 0;
+
foreach my $test_case (@$ran_tests) {
if ($arg_complete) {
$test->output_texi_file($test_case)
} else {
- $test->test($test_case);
+ $test_nrs += $test->test($test_case);
}
}
if ($generate or $arg_complete) {
plan tests => 1;
} else {
- plan tests => (1 + scalar(@$ran_tests) * $nr_comparisons);
+ plan tests => (1 + $test_nrs);
}
}