diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-10-11 18:49:41 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-10-11 18:49:41 +0000 |
commit | 83478c17204ddae131cf1e8b0957d7402b907d83 (patch) | |
tree | 1a2ae1c235ada537b820e4f1b0b5706961bda87e /test/ruby/test_marshal.rb | |
parent | 323fae7ef538932445cadf93ca931a75b5609fe2 (diff) | |
download | ruby-83478c17204ddae131cf1e8b0957d7402b907d83.tar.gz ruby-83478c17204ddae131cf1e8b0957d7402b907d83.tar.xz ruby-83478c17204ddae131cf1e8b0957d7402b907d83.zip |
* marshal.c (has_encoding): added for check the regexp
is dumped by 1.8 or 1.9.
* marshal.c (r_object0): use has_encoding.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25303 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_marshal.rb')
-rw-r--r-- | test/ruby/test_marshal.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/test/ruby/test_marshal.rb b/test/ruby/test_marshal.rb index 676953930..b010dcc46 100644 --- a/test/ruby/test_marshal.rb +++ b/test/ruby/test_marshal.rb @@ -206,11 +206,15 @@ class TestMarshal < Test::Unit::TestCase end def test_regexp + assert_equal(/\\u/, Marshal.load("\004\b/\b\\\\u\000")) + assert_equal(/u/, Marshal.load("\004\b/\a\\u\000")) + assert_equal(/u/, Marshal.load("\004\bI/\a\\u\000\006:\016@encoding\"\vEUC-JP")) + bug2109 = '[ruby-core:25625]' a = "\x82\xa0".force_encoding(Encoding::Windows_31J) b = "\x82\xa2".force_encoding(Encoding::Windows_31J) c = [/#{a}/, /#{b}/] - assert_equal(c, Marshal.load(Marshal.dump(c))) + assert_equal(c, Marshal.load(Marshal.dump(c)), bug2109) end class DumpTest |