Ruby 1.9 Compatibility
Completely removed the html5lib sanitizer. Fixed the string-handling to work in both Ruby 1.8.x and 1.9.2. There are still, inexplicably, two functional tests that fail. But the rest seems to work quite well.
This commit is contained in:
parent
79c8572053
commit
a6429f8c22
142 changed files with 519 additions and 843 deletions
26
attic/vendor/plugins/HTML5lib/test/test_input_stream.rb
vendored
Normal file
26
attic/vendor/plugins/HTML5lib/test/test_input_stream.rb
vendored
Normal file
|
@ -0,0 +1,26 @@
|
|||
require File.join(File.dirname(__FILE__), 'preamble')
|
||||
require "test/unit"
|
||||
require "html5/inputstream"
|
||||
|
||||
class TestHtml5Inputstream < Test::Unit::TestCase
|
||||
def test_newline_in_queue
|
||||
stream = HTML5::HTMLInputStream.new("\nfoo")
|
||||
stream.unget(stream.char)
|
||||
assert_equal [1, 0], stream.position
|
||||
end
|
||||
|
||||
def test_buffer_boundary
|
||||
stream = HTML5::HTMLInputStream.new("abcdefghijklmnopqrstuvwxyz" * 50, :encoding => 'windows-1252')
|
||||
1022.times{stream.char}
|
||||
assert_equal "i", stream.char
|
||||
end
|
||||
|
||||
def test_chars_until
|
||||
stream = HTML5::HTMLInputStream.new("aaaaaaab")
|
||||
assert_equal "aaaaaaa", stream.chars_until("b")
|
||||
|
||||
stream = HTML5::HTMLInputStream.new("aaaaaaab")
|
||||
assert_equal "aaaaaaab", stream.chars_until("c")
|
||||
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue