Compare commits
22 Commits
Author | SHA1 | Date |
---|---|---|
|
0cc7b0dd45 | 3 years ago |
|
c7dcd85cce | 3 years ago |
|
efa8516a67 | 3 years ago |
|
507e1e4d26 | 3 years ago |
|
e6ba398b14 | 3 years ago |
|
e37050c3f4 | 3 years ago |
|
496034258a | 3 years ago |
|
4e1e44a41b | 3 years ago |
|
b71dd1d440 | 3 years ago |
|
e841ca30ad | 3 years ago |
|
1aa376d6ec | 3 years ago |
|
9d407c3706 | 3 years ago |
|
6100cf0f6b | 3 years ago |
|
499b2b6fe4 | 3 years ago |
|
8408d735dc | 3 years ago |
|
d6f4545325 | 3 years ago |
|
39307e24e9 | 3 years ago |
|
08ea243729 | 3 years ago |
|
1bca2ac15c | 3 years ago |
|
d7e17e59df | 3 years ago |
|
289d68fa2f | 3 years ago |
|
abb2dbc690 | 3 years ago |
11 changed files with 301 additions and 15 deletions
@ -0,0 +1,70 @@ |
||||
<?php declare(strict_types=1); |
||||
|
||||
use PHPUnit\Framework\TestCase; |
||||
|
||||
final class AnnotationsTest extends TestCase { |
||||
public function testAnnotationsDoNotBreakHeadings() : void { |
||||
$source = " |
||||
# This is an H1 {.withAClass} |
||||
## This is an H2 {.withAClass} |
||||
### This is an H3 {.withAClass} |
||||
#### This is an H4 {.withAClass} |
||||
##### This is an H5 {.withAClass} |
||||
"; |
||||
$target = " |
||||
<h1>This is an H1</h1> |
||||
<h2>This is an H2</h2> |
||||
<h3>This is an H3</h3> |
||||
<h4>This is an H4</h4> |
||||
<h5>This is an H5</h5> |
||||
"; |
||||
|
||||
[$source, $result] = createTest($source, $target); |
||||
$this->assertEquals($source, $result); |
||||
} |
||||
|
||||
public function testAnnotationsDoNotBreakLists() : void { |
||||
$source = " |
||||
|
||||
* this is a list |
||||
* with annotations {#someID} |
||||
|
||||
1. this is an ordered list |
||||
1. with an annotation {.someClass} |
||||
|
||||
"; |
||||
$target = " |
||||
<ul> |
||||
<li>this is a list</li> |
||||
<li>with annotations</li> |
||||
</ul> |
||||
<ol> |
||||
<li> |
||||
this is an ordered list |
||||
<ol> |
||||
<li>with an annotation</li> |
||||
</ol> |
||||
</li> |
||||
</ol> |
||||
"; |
||||
|
||||
[$source, $result] = createTest($source, $target); |
||||
$this->assertEquals($source, $result); |
||||
} |
||||
|
||||
public function testAnnotationsDoNotBreakCodeblocks() : void { |
||||
$source = " |
||||
``` |
||||
this is a code block |
||||
``` {.someClass} |
||||
"; |
||||
$target = " |
||||
<pre> |
||||
<code>this is a code block</code> |
||||
</pre> |
||||
"; |
||||
|
||||
[$source, $result] = createTest($source, $target); |
||||
$this->assertEquals($source, $result); |
||||
} |
||||
} |
@ -0,0 +1,65 @@ |
||||
<?php declare(strict_types=1); |
||||
|
||||
use PHPUnit\Framework\TestCase; |
||||
|
||||
final class HeadingsTest extends TestCase { |
||||
public function testH1ParsesCorrectly() : void { |
||||
$source = " |
||||
# This is an H1 |
||||
"; |
||||
$target = " |
||||
<h1>This is an H1</h1> |
||||
"; |
||||
|
||||
[$source, $result] = createTest($source, $target); |
||||
$this->assertEquals($source, $result); |
||||
} |
||||
|
||||
public function testH2ParsesCorrectly() : void { |
||||
$source = " |
||||
## This is an H2 |
||||
"; |
||||
$target = " |
||||
<h2>This is an H2</h2> |
||||
"; |
||||
|
||||
[$source, $result] = createTest($source, $target); |
||||
$this->assertEquals($source, $result); |
||||
} |
||||
|
||||
public function testH3ParsesCorrectly() : void { |
||||
$source = " |
||||
### This is an H3 |
||||
"; |
||||
$target = " |
||||
<h3>This is an H3</h3> |
||||
"; |
||||
|
||||
[$source, $result] = createTest($source, $target); |
||||
$this->assertEquals($source, $result); |
||||
} |
||||
|
||||
public function testH4ParsesCorrectly() : void { |
||||
$source = " |
||||
#### This is an H4 |
||||
"; |
||||
$target = " |
||||
<h4>This is an H4</h4> |
||||
"; |
||||
|
||||
[$source, $result] = createTest($source, $target); |
||||
$this->assertEquals($source, $result); |
||||
} |
||||
|
||||
public function testH5ParsesCorrectly() : void { |
||||
$source = " |
||||
##### This is an H5 |
||||
"; |
||||
$target = " |
||||
<h5>This is an H5</h5> |
||||
"; |
||||
|
||||
[$source, $result] = createTest($source, $target); |
||||
$this->assertEquals($source, $result); |
||||
} |
||||
} |
Loading…
Reference in new issue