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

ruby-changes:52063

From: naruse <ko1@a...>
Date: Fri, 10 Aug 2018 18:22:19 +0900 (JST)
Subject: [ruby-changes:52063] naruse:r64271 (trunk): Use assert_separately in TestIseqLoad#test_stressful_roundtrip

naruse	2018-08-10 18:22:13 +0900 (Fri, 10 Aug 2018)

  New Revision: 64271

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

  Log:
    Use assert_separately in TestIseqLoad#test_stressful_roundtrip
    
    It takes 635 seconds on mswinci
    http://mswinci.japaneast.cloudapp.azure.com/vc12-x64/ruby-trunk/log/20180810T061315Z.log.html.gz

  Modified files:
    trunk/test/-ext-/iseq_load/test_iseq_load.rb
Index: test/-ext-/iseq_load/test_iseq_load.rb
===================================================================
--- test/-ext-/iseq_load/test_iseq_load.rb	(revision 64270)
+++ test/-ext-/iseq_load/test_iseq_load.rb	(revision 64271)
@@ -17,10 +17,28 @@ class TestIseqLoad < Test::Unit::TestCas https://github.com/ruby/ruby/blob/trunk/test/-ext-/iseq_load/test_iseq_load.rb#L17
   end
 
   def test_stressful_roundtrip
-    stress, GC.stress = GC.stress, true
+    assert_separately(%w[-r-test-/iseq_load], <<-'end;;')
+  ISeq = RubyVM::InstructionSequence
+  def assert_iseq_roundtrip(src, line=caller_locations(1,1)[0].lineno+1)
+    a = ISeq.compile(src, __FILE__, __FILE__, line).to_a
+    b = ISeq.iseq_load(a).to_a
+    warn diff(a, b) if a != b
+    assert_equal a, b
+    assert_equal a, ISeq.iseq_load(b).to_a
+  end
+  def test_bug8543
+    assert_iseq_roundtrip "#{<<~"begin;"}\n#{<<~'end;'}"
+    begin;
+      puts "tralivali"
+      def funct(a, b)
+        a**b
+      end
+      3.times { |i| puts "Hello, world#{funct(2,i)}!" }
+    end;
+  end
+    GC.stress = true
     test_bug8543
-  ensure
-    GC.stress = stress
+    end;;
   end
 
   def test_case_when

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

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