summaryrefslogtreecommitdiff
path: root/test/json/json_generator_test.rb
diff options
context:
space:
mode:
authorJean Boussier <[email protected]>2024-10-21 22:19:44 +0200
committerHiroshi SHIBATA <[email protected]>2024-10-26 18:44:15 +0900
commitfc9f0cb8c5ead74455370f2ae409bc4a6b1dedc0 (patch)
treef289961afc78ca5903e306e7d17cad870f3e9a46 /test/json/json_generator_test.rb
parent2c6e3bc71e12e12ad6949502e2b161171ca56840 (diff)
[ruby/json] JSON.dump / String#to_json: raise on invalid encoding
This regressed since 2.7.2. https://github.com/ruby/json/commit/35407d6635
Diffstat (limited to 'test/json/json_generator_test.rb')
-rwxr-xr-xtest/json/json_generator_test.rb14
1 files changed, 5 insertions, 9 deletions
diff --git a/test/json/json_generator_test.rb b/test/json/json_generator_test.rb
index 6730898d4f..7dc45e3a52 100755
--- a/test/json/json_generator_test.rb
+++ b/test/json/json_generator_test.rb
@@ -449,16 +449,12 @@ EOT
end
assert_includes error.message, "source sequence is illegal/malformed utf-8"
- # These pass on the pure-Ruby generator but not with the native extension
- # https://github.com/ruby/json/issues/634
- if defined?(JSON::Pure)
- assert_raise(Encoding::UndefinedConversionError) do
- "\x82\xAC\xEF".b.to_json
- end
+ assert_raise(Encoding::UndefinedConversionError) do
+ "\x82\xAC\xEF".b.to_json
+ end
- assert_raise(Encoding::UndefinedConversionError) do
- JSON.dump("\x82\xAC\xEF".b)
- end
+ assert_raise(Encoding::UndefinedConversionError) do
+ JSON.dump("\x82\xAC\xEF".b)
end
end