Skip to content

Commit 99aefde

Browse files
Add test case for 48b84a3
1 parent 48b84a3 commit 99aefde

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

tests/test-table-ascii.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,35 @@ public function testTableWithPercentCharacters() {
146146
| % at start | at end % | in % middle |
147147
+------------+----------+-------------+
148148

149+
OUT;
150+
$this->assertInOutEquals(array($headers, $rows), $output);
151+
}
152+
153+
/**
154+
* Test that a % is appropriately padded in the table
155+
*/
156+
public function testTablePaddingWithPercentCharacters() {
157+
$headers = array( 'ID', 'post_title', 'post_name' );
158+
$rows = array(
159+
array(
160+
3,
161+
'10%',
162+
''
163+
),
164+
array(
165+
1,
166+
'Hello world!',
167+
'hello-world'
168+
),
169+
);
170+
$output = <<<'OUT'
171+
+----+--------------+-------------+
172+
| ID | post_title | post_name |
173+
+----+--------------+-------------+
174+
| 3 | 10% | |
175+
| 1 | Hello world! | hello-world |
176+
+----+--------------+-------------+
177+
149178
OUT;
150179
$this->assertInOutEquals(array($headers, $rows), $output);
151180
}

0 commit comments

Comments
 (0)