summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-03-06 08:53:51 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-03-06 08:53:51 +0000
commitf5452efcf863e4c15577e53c52e6e8726e70f5c4 (patch)
tree737c4f5fe79c44912f5f9ff0b4aadda7f623c2af /test
parentfbc070d14aead827a6d5250b36d8119e079162e0 (diff)
merge revision(s) 67167: [Backport #15635]
string.c: respect the actual encoding * string.c (rb_enc_str_coderange): respect the actual encoding of if a BOM presents, and scan for the actual code range. [ruby-core:91662] [Bug #15635] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_6@67181 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_m17n.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_m17n.rb b/test/ruby/test_m17n.rb
index c1184c551f..75daf61376 100644
--- a/test/ruby/test_m17n.rb
+++ b/test/ruby/test_m17n.rb
@@ -269,6 +269,13 @@ class TestM17N < Test::Unit::TestCase
assert_empty(encs, bug10598)
end
+ def test_utf_without_bom_valid
+ encs = [Encoding::UTF_16, Encoding::UTF_32].find_all {|enc|
+ !(+"abcd").encode!(enc).force_encoding(enc).valid_encoding?
+ }
+ assert_empty(encs)
+ end
+
def test_object_utf16_32_inspect
EnvUtil.suppress_warning do
begin