Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki
This commit is contained in:
commit
48e6bd5f74
|
@ -42,4 +42,10 @@ class NoWikiTest < Test::Unit::TestCase
|
|||
)
|
||||
end
|
||||
|
||||
def test_sanitize_nowiki_bad_utf8
|
||||
match(NoWiki, "<nowiki>\357elephant & \302ivory</nowiki>",
|
||||
:plain_text => "\357\277\275elephant & \357\277\275ivory"
|
||||
)
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -39,6 +39,12 @@ class SanitizeTest < Test::Unit::TestCase
|
|||
assert_equal(output, my_rex(input))
|
||||
assert_equal(output2, input.to_utf8)
|
||||
end
|
||||
|
||||
def test_sanitize_malformed_utf8
|
||||
input = "<p>\357elephant & \302ivory</p>"
|
||||
output = "<p>\357\277\275elephant & \357\277\275ivory</p>"
|
||||
check_sanitization(input, output, output, output)
|
||||
end
|
||||
|
||||
Sanitizer::ALLOWED_ELEMENTS.each do |tag_name|
|
||||
define_method "test_should_allow_#{tag_name}_tag" do
|
||||
|
|
|
@ -30,6 +30,12 @@ class SanitizerTest < Test::Unit::TestCase
|
|||
assert_equal(output2, input.to_utf8)
|
||||
end
|
||||
|
||||
def test_sanitize_malformed_utf8
|
||||
input = "<p>\357elephant & \302ivory</p>".purify
|
||||
output = "<p>ephant & vory</p>"
|
||||
check_sanitization(input, output, output, output)
|
||||
end
|
||||
|
||||
Sanitizer::ALLOWED_ELEMENTS.each do |tag_name|
|
||||
define_method "test_should_allow_#{tag_name}_tag" do
|
||||
input = "<#{tag_name} title='1'>foo <bad>bar</bad> baz</#{tag_name}>"
|
||||
|
|
Loading…
Reference in a new issue