ruby-changes:14800
From: akr <ko1@a...>
Date: Sun, 14 Feb 2010 11:45:16 +0900 (JST)
Subject: [ruby-changes:14800] Ruby:r26662 (trunk): add a test.
akr 2010-02-14 11:40:52 +0900 (Sun, 14 Feb 2010) New Revision: 26662 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=26662 Log: add a test. Modified files: trunk/test/ruby/test_marshal.rb Index: test/ruby/test_marshal.rb =================================================================== --- test/ruby/test_marshal.rb (revision 26661) +++ test/ruby/test_marshal.rb (revision 26662) @@ -429,10 +429,25 @@ assert_equal(STDIN, o.stdin) end - def test_marshal_encoding - o = ["foo".force_encoding("EUC-JP")] + [ "bar" ] * 2 - m = Marshal.dump(o) + def test_marshal_string_encoding + o1 = ["foo".force_encoding("EUC-JP")] + [ "bar" ] * 2 + m = Marshal.dump(o1) o2 = Marshal.load(m) - assert_equal(o, o2, "[ruby-dev:40388]") + assert_equal(o1, o2, "[ruby-dev:40388]") end + + def test_marshal_regexp_encoding + o1 = [Regexp.new("r1".force_encoding("EUC-JP"))] + ["r2"] * 2 + m = Marshal.dump(o1) + o2 = Marshal.load(m) + assert_equal(o1, o2, "[ruby-dev:40416]") + end + + def test_marshal_encoding_encoding + o1 = [Encoding.find("EUC-JP")] + ["r2"] * 2 + m = Marshal.dump(o1) + o2 = Marshal.load(m) + assert_equal(o1, o2) + end + end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/