summary refs log tree commit
path: root/tests/test_json.rb
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_json.rb')
-rwxr-xr-xtests/test_json.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/test_json.rb b/tests/test_json.rb
index 5b43ec9..825a507 100755
--- a/tests/test_json.rb
+++ b/tests/test_json.rb
@@ -415,4 +415,10 @@ EOT
       assert_raise(TypeError, '[ruby-core:35079]') {parser.source}
     end
   end
+
+  def test_argument_encoding
+    source = "{}".force_encoding("ascii-8bit")
+    JSON::Parser.new(source)
+    assert_equal Encoding::ASCII_8BIT, source.encoding
+  end if defined?(Encoding::ASCII_8BIT)
 end