summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-10-11 18:49:41 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-10-11 18:49:41 +0000
commit8ab0220352de7d4acfcbb45a25ef3de54233c8c5 (patch)
tree1a2ae1c235ada537b820e4f1b0b5706961bda87e /test
parent334241e3ed0fdd8d654aab56129c50008e797b7f (diff)
* 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@25303 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_marshal.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/ruby/test_marshal.rb b/test/ruby/test_marshal.rb
index 6769539303..b010dcc46f 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