From 72fb77606d82cfb43ee28492fd7469af0dc62634 Mon Sep 17 00:00:00 2001 From: naruse Date: Fri, 10 Jul 2009 05:51:28 +0000 Subject: Add test for marshaling regexp. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24016 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/marshaltestlib.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/marshaltestlib.rb b/test/ruby/marshaltestlib.rb index 5da7ad95d..8c55a086a 100644 --- a/test/ruby/marshaltestlib.rb +++ b/test/ruby/marshaltestlib.rb @@ -1,3 +1,4 @@ +# coding: utf-8 module MarshalTestLib # include this module to a Test::Unit::TestCase and definde encode(o) and # decode(s) methods. e.g. @@ -245,6 +246,12 @@ module MarshalTestLib marshal_equal(/a/) marshal_equal(/A/i) marshal_equal(/A/mx) + marshal_equal(/a\u3042/) + marshal_equal(/a恂/) + assert_equal(Regexp.new("恂".force_encoding("ASCII-8BIT")), + Marshal.load("\004\b/\b\343\201\202\000")) + assert_equal(/au3042/, Marshal.load("\004\b/\fa\\u3042\000")) + #assert_equal(/au3042/u, Marshal.load("\004\b/\fa\\u3042@")) # spec end def test_regexp_subclass -- cgit