test/unit/parser_test.rb in html_tokenizer-0.0.2 vs test/unit/parser_test.rb in html_tokenizer-0.0.3
- old
+ new
@@ -562,9 +562,18 @@
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">',
)
assert_equal 0, @parser.errors_count, "Expected no errors: #{@parser.errors}"
end
+ def test_doctype_without_space
+ parse('<!DOCTYPE')
+ assert_equal "!DOCTYPE", @parser.tag_name
+ parse('foo')
+ assert_equal "!DOCTYPEfoo", @parser.tag_name
+
+ assert_equal 0, @parser.errors_count, "Expected no errors: #{@parser.errors}"
+ end
+
private
def parse(*parts, &block)
@parser ||= HtmlTokenizer::Parser.new
parts.each do |part|