Skip to content

Commit ccdfb12

Browse files
committed
This commit includes tests for the following bugs:
+ RT #124403 - Table parsing broken in Rakudo + RT #128221 - Weird internal error when parsing some very simple pod... + RT #129862 - Pod::To::Text failing on uneven row lengths + RT #132341 - table handling should ensure table rows have the same number of cells... + RT #132348 - tables should accept an inline comment (Z<some comment>) Note that this commit should only be used with Rakudo after incorporating its PR #1240.
1 parent 3636ca7 commit ccdfb12

File tree

2 files changed

+29
-8
lines changed

2 files changed

+29
-8
lines changed

S26-documentation/07a-tables.t

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use Test;
44
my ($r, $p, $hdrs, @rows);
55
$p = -1; # starting index for pod number
66

7-
plan 33;
7+
plan 37;
88

99
# includes tests for fixes for RT bugs:
1010
# 124403 - incorrect table parse:
@@ -88,6 +88,7 @@ is $r.contents[1].elems, 3;
8888
is $r.contents[2].elems, 3;
8989

9090
# test fix for RT #132341
91+
# also tests fix for RT #129862
9192
=table
9293
X O
9394
===========
@@ -106,6 +107,7 @@ is $r.contents[1].elems, 3;
106107
is $r.contents[2].elems, 3;
107108

108109
# test fix for RT #132348 (allow inline Z comments)
110+
# also tests fix for RT #129862
109111
=begin table
110112
a | b | c
111113
l | m | n
@@ -116,3 +118,23 @@ is $r.contents.elems, 3;
116118
is $r.contents[0].join(','), 'a,b,c';
117119
is $r.contents[1].join(','), 'l,m,n';
118120
is $r.contents[2].join(','), 'x,y,';
121+
122+
# a single column table, no headers
123+
=begin table
124+
a
125+
=end table
126+
127+
$r = $=pod[++$p];
128+
is $r.headers.elems, 0;
129+
is $r.contents.elems, 1;
130+
131+
# a single column table, with header
132+
=begin table
133+
b
134+
-
135+
a
136+
=end table
137+
138+
$r = $=pod[++$p];
139+
is $r.headers.elems, 1;
140+
is $r.contents.elems, 1;

S26-documentation/07b-tables.t

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,16 @@ use Test;
33

44
plan 4;
55

6-
# test for the two fatal table failures
6+
# test for the two designed fatal table failures
77

8-
# empty table should cause an exception
8+
# empty tables should cause an exception
99
my $table1 = qq:to/HERE/;
1010
=begin table
1111
=end table
1212
HERE
1313

1414
my $table2 = qq:to/HERE/;
1515
=table
16-
1716
HERE
1817

1918
# consecutive row separators should cause an exception
@@ -32,7 +31,7 @@ my $table4 = qq:to/HERE/;
3231
4 5 6
3332
HERE
3433

35-
eval-dies-ok $table1;
36-
eval-dies-ok $table2;
37-
eval-dies-ok $table3;
38-
eval-dies-ok $table4;
34+
eval-dies-ok $table1, "dies-ok, empty table";
35+
eval-dies-ok $table2, "dies-ok, empty table";
36+
eval-dies-ok $table3, "dies-ok, consecutive row separators";
37+
eval-dies-ok $table4, "dies-ok, mixed ws and vis col separators";

0 commit comments

Comments
 (0)