From 4e2989ee8f53d421e9fef21df67420629285b357 Mon Sep 17 00:00:00 2001 From: usa Date: Wed, 31 Jan 2018 13:28:39 +0000 Subject: merge revision(s) 60059: [Backport #13949] 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/branches/ruby_2_3@62138 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_pack.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_pack.rb b/test/ruby/test_pack.rb index b0046b2a27..b0fd0b7158 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".unpack("M").first + assert_equal(Encoding::ASCII_8BIT, s.encoding) + assert_predicate(s, :ascii_only?, bug) end def test_pack_unpack_P2 -- cgit v1.2.3