summaryrefslogtreecommitdiff
path: root/test/-ext-/string
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-12-02 07:09:16 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-12-02 07:09:16 +0000
commita1692f7fdf62dc109886d9910b4dcca635dc2e25 (patch)
tree0ee70c17ab6346aa9a6ca97a02c2747707403f63 /test/-ext-/string
parentf32bf7e67802000d9d097f3008dee0ca980ecc21 (diff)
string.c: fix rb_external_str_new_with_enc
* string.c (rb_external_str_new_with_enc): do not search non-ascii by NULL pointer. [ruby-core:84055] [Bug #14150] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60979 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/-ext-/string')
-rw-r--r--test/-ext-/string/test_external_new.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/-ext-/string/test_external_new.rb b/test/-ext-/string/test_external_new.rb
new file mode 100644
index 0000000..f7c7908
--- /dev/null
+++ b/test/-ext-/string/test_external_new.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: false
+require 'test/unit'
+require '-test-/string'
+
+class Test_StringExternalNew < Test::Unit::TestCase
+ def test_external_new_with_enc
+ Encoding.list.each do |enc|
+ assert_equal(enc, Bug::String.external_new(0, enc).encoding)
+ end
+ end
+end