summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/json/json_parser_test.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/json/json_parser_test.rb b/test/json/json_parser_test.rb
index 610ea06f3f..d76281e6bc 100644
--- a/test/json/json_parser_test.rb
+++ b/test/json/json_parser_test.rb
@@ -26,6 +26,12 @@ class JSONParserTest < Test::Unit::TestCase
assert_equal Encoding::UTF_16, source.encoding
end if defined?(Encoding::UTF_16)
+ def test_argument_encoding_for_binary
+ source = "{}".encode("ASCII-8BIT")
+ JSON::Parser.new(source)
+ assert_equal Encoding::ASCII_8BIT, source.encoding
+ end if defined?(Encoding::ASCII_8BIT)
+
def test_error_message_encoding
pend if RUBY_ENGINE == 'truffleruby'