diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-02 07:09:16 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-02 07:09:16 +0000 |
commit | a1692f7fdf62dc109886d9910b4dcca635dc2e25 (patch) | |
tree | 0ee70c17ab6346aa9a6ca97a02c2747707403f63 /test/-ext-/string/test_external_new.rb | |
parent | f32bf7e67802000d9d097f3008dee0ca980ecc21 (diff) | |
download | ruby-a1692f7fdf62dc109886d9910b4dcca635dc2e25.tar.gz |
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/test_external_new.rb')
-rw-r--r-- | test/-ext-/string/test_external_new.rb | 11 |
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 0000000000..f7c7908db7 --- /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 |