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

ruby-changes:45200

From: nobu <ko1@a...>
Date: Fri, 6 Jan 2017 12:02:44 +0900 (JST)
Subject: [ruby-changes:45200] nobu:r57273 (trunk): test_io.rb: squiggly heredoc

nobu	2017-01-06 12:02:38 +0900 (Fri, 06 Jan 2017)

  New Revision: 57273

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=57273

  Log:
    test_io.rb: squiggly heredoc
    
    * test/ruby/test_io.rb (test_threaded_flush): use squiggly here
      document to strip leading spaces.

  Modified files:
    trunk/test/ruby/test_io.rb
Index: test/ruby/test_io.rb
===================================================================
--- test/ruby/test_io.rb	(revision 57272)
+++ test/ruby/test_io.rb	(revision 57273)
@@ -2527,11 +2527,12 @@ __END__ https://github.com/ruby/ruby/blob/trunk/test/ruby/test_io.rb#L2527
 
   def test_threaded_flush
     bug3585 = '[ruby-core:31348]'
-    src = %q{\
+    src = "#{<<~"begin;"}\n#{<<~'end;'}"
+    begin;
       t = Thread.new { sleep 3 }
       Thread.new {sleep 1; t.kill; p 'hi!'}
       t.join
-    }.gsub(/^\s+/, '')
+    end;
     10.times.map do
       Thread.start do
         assert_in_out_err([], src) {|stdout, stderr|

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

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