@@ -12,6 +12,7 @@ plan 42;
12
12
= end table
13
13
14
14
$ r = $ = pod [0 ];
15
+ # tests 1-6:
15
16
isa-ok $ r , Pod ::Block::Table;
16
17
is $ r . contents. elems , 4 ;
17
18
is $ r . contents[0 ]. join (' |' ),
@@ -30,6 +31,7 @@ is $r.contents[3].join('|'),
30
31
Everything else 57
31
32
32
33
$ r = $ = pod [1 ];
34
+ # tests 7-11:
33
35
is $ r . contents. elems , 4 ;
34
36
is $ r . contents[0 ]. join (' |' ), " Constants|1" ;
35
37
is $ r . contents[1 ]. join (' |' ), " Variables|10" ;
@@ -42,6 +44,7 @@ is $r.contents[3].join('|'), "Everything else|57";
42
44
elephant | elephants
43
45
44
46
$ r = $ = pod [2 ];
47
+ # tests 12-15:
45
48
is $ r . contents. elems , 3 ;
46
49
is $ r . contents[0 ]. join (' |' ), " mouse|mice" ;
47
50
is $ r . contents[1 ]. join (' |' ), " horse|horses" ;
@@ -55,6 +58,7 @@ is $r.contents[2].join('|'), "elephant|elephants";
55
58
Shark + 0 + Fish
56
59
57
60
$ r = $ = pod [3 ];
61
+ # tests 16-20:
58
62
is $ r . headers. join (' |' ), " Animal|Legs|Eats" ;
59
63
is $ r . contents. elems , 3 ;
60
64
is $ r . contents[0 ]. join (' |' ), " Zebra|4|Cookies" ;
@@ -68,6 +72,7 @@ is $r.contents[2].join('|'), "Shark|0|Fish";
68
72
The Shoveller | Eddie Stevens | King Arthur's singing shovel
69
73
70
74
$ r = $ = pod [4 ];
75
+ # tests 21-23:
71
76
is $ r . headers. join (' |' ), " Superhero|Secret Identity|Superpower" ;
72
77
is $ r . contents. elems , 1 ;
73
78
is $ r . contents[0 ]. join (' |' ),
@@ -91,6 +96,7 @@ is $r.contents[0].join('|'),
91
96
= end table
92
97
93
98
$ r = $ = pod [5 ];
99
+ # tests 24-29:
94
100
is $ r . headers. join (' |' ), " Superhero|Secret Identity|Superpower" ;
95
101
is $ r . contents. elems , 4 ;
96
102
is $ r . contents[0 ]. join (' |' ),
@@ -103,29 +109,35 @@ is $r.contents[3].join('|'),
103
109
" The Bowler|Carol Pinnsler|Haunted bowling ball" ;
104
110
105
111
= table
106
- X | O |
107
- -- -+ -- -+ -- -
108
- | X | O
109
- -- -+ -- -+ -- -
110
- | | X
112
+ X | O |
113
+ -- -+ -- -+ -- -
114
+ | X | O
115
+ -- -+ -- -+ -- -
116
+ | | X
117
+
111
118
112
119
$ r = $ = pod [6 ];
120
+ # tests 30-33:
113
121
is $ r . contents. elems , 3 ;
122
+ my $ s1 := $ r . contents[0 ]. join (' ,' );
114
123
is $ r . contents[0 ]. join (' ,' ), ' X,O,' ,
115
- ' ensure trailing whitespace counts as a cell (WARNING: this test will'
116
- ~ ' fail if you modified this file and your editor auto-stripped'
117
- ~ ' trailing whitespace)' ;
118
- is $ r . contents[1 ]. join (' ,' ), ' ,X,O' ;
119
- is $ r . contents[2 ]. join (' ,' ), ' ,,X' ;
124
+ " got '$ s1 '; ensure trailing whitespace counts as a cell (WARNING: this test will"
125
+ ~ " fail if you modified this file and your editor auto-stripped"
126
+ ~ " trailing whitespace)" ;
127
+ my $ s2 := $ r . contents[1 ]. join (' ,' );
128
+ is $ r . contents[1 ]. join (' ,' ), ' ,X,O' , " got '$ s2 '" ;
129
+ my $ s3 := $ r . contents[1 ]. join (' ,' );
130
+ is $ r . contents[2 ]. join (' ,' ), ' ,,X' , " got '$ s3 '" ;
120
131
121
132
= table
122
- X O
133
+ X O
123
134
===========
124
- X O
135
+ X O
125
136
===========
126
- X
137
+ X
127
138
128
139
$ r = $ = pod [7 ];
140
+ # tests 34-37:
129
141
is $ r . contents. elems , 3 ;
130
142
is $ r . contents[0 ]. join (' ,' ), ' X,O,' ,
131
143
' ensure trailing whitespace counts as a cell (WARNING: this test will'
142
154
= end table
143
155
144
156
$ r = $ = pod [8 ];
157
+ # test 38:
145
158
is $ r . contents. elems , 2 ;
146
159
147
160
# test for issue #129862
@@ -158,6 +171,7 @@ x | y
158
171
= end table
159
172
160
173
$ r = $ = pod [9 ];
174
+ # test 39-42:
161
175
is $ r . contents. elems , 3 ;
162
176
is $ r . contents[0 ]. join (' ,' ), ' a,b,c' ;
163
177
is $ r . contents[1 ]. join (' ,' ), ' l,m,n' ;
0 commit comments