Gentoo Archives: gentoo-commits

From: "Torsten Veller (tove)" <tove@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-perl/HTML-TableContentParser/files: 0.13-test.patch
Date: Thu, 07 Jan 2010 14:12:45
Message-Id: E1NSt6Q-0004YQ-PF@stork.gentoo.org
1 tove 10/01/07 14:12:42
2
3 Added: 0.13-test.patch
4 Log:
5 Fix test failure on perl-5.10.1 (#300013). Thanks to David Abbott
6 (Portage version: 2.2_rc61/cvs/Linux x86_64)
7
8 Revision Changes Path
9 1.1 dev-perl/HTML-TableContentParser/files/0.13-test.patch
10
11 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-perl/HTML-TableContentParser/files/0.13-test.patch?rev=1.1&view=markup
12 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-perl/HTML-TableContentParser/files/0.13-test.patch?rev=1.1&content-type=text/plain
13
14 Index: 0.13-test.patch
15 ===================================================================
16 --- t/1.t
17 +++ t/1.t
18 @@ -2,6 +2,8 @@
19
20
21 use Test;
22 +use strict;
23 +use warnings;
24
25 BEGIN { plan tests => 34 }
26
27 @@ -20,7 +22,7 @@
28
29 ## Test object creation
30
31 -$obj = HTML::TableContentParser->new();
32 +my $obj = HTML::TableContentParser->new();
33 ok(defined $obj, 1, $@);
34
35
36 @@ -29,14 +31,14 @@
37 ## the correct values to the callback.
38
39
40 -$table_caption = 'This is a caption';
41 -$table_content1 = 'This is table cell content 1';
42 -$table_content2 = 'This is table cell content 2';
43 -$table_content3 = '<a href="SomeLink">This is table cell content 3, a link</a>';
44 -$table_content4 = 'Some more text wrapping <a href="SomeLink">This is table cell content 4</a> a link.';
45 -$header_text = 'Header text';
46 +my $table_caption = 'This is a caption';
47 +my $table_content1 = 'This is table cell content 1';
48 +my $table_content2 = 'This is table cell content 2';
49 +my $table_content3 = '<a href="SomeLink">This is table cell content 3, a link</a>';
50 +my $table_content4 = 'Some more text wrapping <a href="SomeLink">This is table cell content 4</a> a link.';
51 +my $header_text = 'Header text';
52
53 -$html = qq{
54 +my $html = qq{
55 <html>
56 <head>
57 </head>
58 @@ -59,7 +61,7 @@
59
60
61 $HTML::TableContentParser::DEBUG = 0;
62 -$tables = $obj->parse($html);
63 +my $tables = $obj->parse($html);
64 ok($tables->[0]->{caption}->{data}, $table_caption, $@);
65 ok($tables->[0]->{rows}->[0]->{cells}->[0]->{data}, $table_content1, $@);
66 ok($tables->[0]->{rows}->[1]->{cells}->[0]->{data}, $table_content2, $@);
67 @@ -124,16 +126,17 @@
68 ok(@$tables, 2, @_);
69
70 ## and three headers for each table
71 -for $t (0..$#{@$tables}) {
72 - for (0..$#hdrs) {
73 - ok($tables->[$t]->{headers}->[$_]->{data}, $hdrs[$_], $@);
74 +for my $t (0..(@$tables-1)) {
75 + for (0..2) {
76 + # ok($t, $t);
77 + ok($tables->[$t]->{headers}->[$_]->{data}, $hdrs[$_], $@);
78 }
79 }
80
81
82 ## and three rows of three cells each, for each table.. (18 total).
83 -for $t (0..$#{@$tables}) {
84 - for $r (0..$#rows) {
85 +for my $t (0..1) {
86 + for my $r (0..$#rows) {
87 for (0..2) {
88 ok($tables->[$t]->{rows}->[$r]->{cells}->[$_]->{data}, $rows[$r]->[$_], $@);
89 }