[前][次][番号順一覧][スレッド一覧]

ruby-changes:25805

From: usa <ko1@a...>
Date: Mon, 26 Nov 2012 20:25:57 +0900 (JST)
Subject: [ruby-changes:25805] usa:r37862 (trunk): * test/ruby/test_argf.rb (TestArgf#test_chars): since marshal data is

usa	2012-11-26 20:25:45 +0900 (Mon, 26 Nov 2012)

  New Revision: 37862

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=37862

  Log:
    * test/ruby/test_argf.rb (TestArgf#test_chars): since marshal data is
      binary, shouldn't pass via text mode.  use base64 encoded data.

  Modified files:
    trunk/ChangeLog
    trunk/test/ruby/test_argf.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 37861)
+++ ChangeLog	(revision 37862)
@@ -1,3 +1,8 @@
+Mon Nov 26 20:23:49 2012  NAKAMURA Usaku  <usa@r...>
+
+	* test/ruby/test_argf.rb (TestArgf#test_chars): since marshal data is
+	  binary, shouldn't pass via text mode.  use base64 encoded data.
+
 Mon Nov 26 19:45:18 2012  KOSAKI Motohiro  <kosaki.motohiro@g...>
 
 	* ruby_atomic.h (ATOMIC_CAS): new macro for compare-and-exchange.
Index: test/ruby/test_argf.rb
===================================================================
--- test/ruby/test_argf.rb	(revision 37861)
+++ test/ruby/test_argf.rb	(revision 37862)
@@ -781,9 +781,9 @@
 
   def test_chars
     ruby('-e', <<-SRC, @t1.path, @t2.path, @t3.path) do |f|
-      print Marshal.dump(ARGF.chars.to_a)
+      print [Marshal.dump(ARGF.chars.to_a)].pack('m')
     SRC
-      assert_equal(["1", "\n", "2", "\n", "3", "\n", "4", "\n", "5", "\n", "6", "\n"], Marshal.load(f.read))
+    assert_equal(["1", "\n", "2", "\n", "3", "\n", "4", "\n", "5", "\n", "6", "\n"], Marshal.load(f.read.unpack('m').first))
     end
   end
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]