ruby-changes:12321
From: naruse <ko1@a...>
Date: Fri, 10 Jul 2009 14:51:38 +0900 (JST)
Subject: [ruby-changes:12321] Ruby:r24016 (trunk): Add test for marshaling regexp.
naruse 2009-07-10 14:51:28 +0900 (Fri, 10 Jul 2009) New Revision: 24016 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=24016 Log: Add test for marshaling regexp. Modified files: trunk/test/ruby/marshaltestlib.rb Index: test/ruby/marshaltestlib.rb =================================================================== --- test/ruby/marshaltestlib.rb (revision 24015) +++ test/ruby/marshaltestlib.rb (revision 24016) @@ -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 @@ 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/