aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-09-29 08:00:47 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-09-29 08:00:47 +0000
commit6164e8691a4378bf9cc2c159e4bb01e47f12d3cf (patch)
tree230f8ce7f04fdd5212f619acbeed7bd1724b362a /test
parent14dfef643206f76b889682b3f8fdfa275ccceace (diff)
downloadruby-6164e8691a4378bf9cc2c159e4bb01e47f12d3cf.tar.gz
pack.c: unpack "M" may be ASCII only
* pack.c (pack_unpack_internal): set ASCII only properly on "M", may be ASCII only. [ruby-core:83055] [Bug #13949] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60059 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_pack.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_pack.rb b/test/ruby/test_pack.rb
index 6d2eecbc9f..f5b3266803 100644
--- a/test/ruby/test_pack.rb
+++ b/test/ruby/test_pack.rb
@@ -686,6 +686,11 @@ EXPECTED
assert_equal(["pre=hoge"], "pre=hoge".unpack("M"))
assert_equal(["pre==31after"], "pre==31after".unpack("M"))
assert_equal(["pre===31after"], "pre===31after".unpack("M"))
+
+ bug = '[ruby-core:83055] [Bug #13949]'
+ s = "abcdef".unpack1("M")
+ assert_equal(Encoding::ASCII_8BIT, s.encoding)
+ assert_predicate(s, :ascii_only?, bug)
end
def test_pack_unpack_P2