summaryrefslogtreecommitdiffstats
path: root/test/ruby
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-13 08:08:14 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-13 08:08:14 +0000
commit66bdd92bba70a5a4958f77141744f69bdf2a4485 (patch)
tree791f72c9b4fa90d8e2bd8ea1ba81e52f6ca8cfd4 /test/ruby
parent1f093e000b0d82bea863d4453c83f6825b6cfa78 (diff)
merges r24016 from trunk into ruby_1_9_1.
-- Add test for marshaling regexp. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@24080 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/marshaltestlib.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/marshaltestlib.rb b/test/ruby/marshaltestlib.rb
index 4486a7842..f16910cd7 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