mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 16:44:01 +02:00
JSONPure: String#to_json should raise on invalid encoding
Fix: #344 This matches the ext behavior.
This commit is contained in:
parent
8fdd3d0ed6
commit
718c4f7e1e
1 changed files with 7 additions and 0 deletions
|
@ -438,6 +438,13 @@ EOT
|
|||
end
|
||||
end
|
||||
|
||||
def test_invalid_encoding_string
|
||||
error = assert_raise(JSON::GeneratorError) do
|
||||
"\x82\xAC\xEF".to_json
|
||||
end
|
||||
assert_includes error.message, "source sequence is illegal/malformed utf-8"
|
||||
end
|
||||
|
||||
if defined?(JSON::Ext::Generator) and RUBY_PLATFORM != "java"
|
||||
def test_string_ext_included_calls_super
|
||||
included = false
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue