diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-08-10 09:22:13 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-08-10 09:22:13 +0000 |
commit | d561eb665db791088b62d03749fec57320ee1c2b (patch) | |
tree | c52f3d4db6ddbac7388013c1aab2f9fc9746ce60 /test/-ext- | |
parent | 163b830d70dabe629816bf7ecf8e5ad3bd511c3e (diff) |
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
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64271 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/-ext-')
-rw-r--r-- | test/-ext-/iseq_load/test_iseq_load.rb | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/test/-ext-/iseq_load/test_iseq_load.rb b/test/-ext-/iseq_load/test_iseq_load.rb index 7a8120ad1c..86db04f16d 100644 --- a/test/-ext-/iseq_load/test_iseq_load.rb +++ b/test/-ext-/iseq_load/test_iseq_load.rb @@ -17,10 +17,28 @@ class TestIseqLoad < Test::Unit::TestCase 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 |