summaryrefslogtreecommitdiff
path: root/tests/json_parser_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'tests/json_parser_test.rb')
-rw-r--r--tests/json_parser_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/json_parser_test.rb b/tests/json_parser_test.rb
index f34bc02..40ad500 100644
--- a/tests/json_parser_test.rb
+++ b/tests/json_parser_test.rb
@@ -449,6 +449,13 @@ EOT
assert_equal obj, obj_again
end
+ def test_parsing_frozen_ascii8bit_string
+ assert_equal(
+ { 'foo' => 'bar' },
+ JSON('{ "foo": "bar" }'.force_encoding(Encoding::ASCII_8BIT).freeze)
+ )
+ end
+
private
def assert_equal_float(expected, actual, delta = 1e-2)