From 892335b82e3587fbb96ef4ef62bb1edd16ad636f Mon Sep 17 00:00:00 2001 From: Technosophos Date: Thu, 11 Apr 2013 21:14:22 -0500 Subject: endTag is done. --- test/HTML5/Parser/TokenizerTest.php | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'test/HTML5/Parser/TokenizerTest.php') diff --git a/test/HTML5/Parser/TokenizerTest.php b/test/HTML5/Parser/TokenizerTest.php index c31d74b..cae2adb 100644 --- a/test/HTML5/Parser/TokenizerTest.php +++ b/test/HTML5/Parser/TokenizerTest.php @@ -102,6 +102,8 @@ class TokenizerTest extends \HTML5\Tests\TestCase { '' => 'test', '' => 'test', + '' => + 'thisIsTheTagThatDoesntEndItJustGoesOnAndOnMyFriend', // See 8.2.4.10, which requires this and does not say error. '' => 'a' => 'a', '' => 'a', - '' => 'a', - '' => '', - '' => '', + '' => 'a', + '' => 'a', ); foreach ($fail as $test => $result) { $events = $this->parse($test); @@ -132,5 +134,23 @@ class TokenizerTest extends \HTML5\Tests\TestCase { $this->assertEquals($result, $e1['data'][0], "Parse end tag " . $test); $this->assertEquals(3, $events->depth()); } + + // BogoComments + $comments = array( + '' => '', + '' => '', + '' => '', + ); + foreach ($comments as $test => $result) { + $events = $this->parse($test); + // Should have triggered an error. + $e0 = $events->get(0); + $this->assertEquals('error', $e0['name'], "Parsing $test expects a leading error." . print_r($events, TRUE)); + // Should have tried to parse anyway. + $e1 = $events->get(1); + $this->assertEquals('comment', $e1['name'], "Parsing $test expects comment." . print_r($events, TRUE)); + $this->assertEquals($result, $e1['data'][0], "Parse end tag " . $test); + $this->assertEquals(3, $events->depth()); + } } } -- cgit v1.2.3