summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-06 05:29:07 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-06 05:29:07 +0000
commit98ff2bbd7a9d033a629644a4576e5293eea3dc53 (patch)
tree74fae8d2d38fde90e70e2378eb706ad671fcac75 /test
parent8a52020f958233dfb0896f5c051caf97a2fa3e7c (diff)
Show diff in failure messages
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66236 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/-ext-/iseq_load/test_iseq_load.rb45
1 files changed, 23 insertions, 22 deletions
diff --git a/test/-ext-/iseq_load/test_iseq_load.rb b/test/-ext-/iseq_load/test_iseq_load.rb
index 969eb39a25..f96117b163 100644
--- a/test/-ext-/iseq_load/test_iseq_load.rb
+++ b/test/-ext-/iseq_load/test_iseq_load.rb
@@ -17,27 +17,28 @@ class TestIseqLoad < Test::Unit::TestCase
end
def test_stressful_roundtrip
- assert_separately(%w[-r-test-/iseq_load], <<-'end;;', timeout: 30)
- 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;'}"
+ assert_separately(%w[-r-test-/iseq_load], "#{<<~"begin;"}\n#{<<~'end;;'}", timeout: 30)
begin;
- puts "tralivali"
- def funct(a, b)
- a**b
+ 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
+ assert_equal a, b, proc {diff(a, b)}
+ b = ISeq.iseq_load(b).to_a
+ assert_equal a, b, proc {diff(a, b)}
end
- 3.times { |i| puts "Hello, world#{funct(2,i)}!" }
- end;
- end
- GC.stress = true
- test_bug8543
+ 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
end;;
end
@@ -80,9 +81,9 @@ class TestIseqLoad < Test::Unit::TestCase
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
+ assert_equal a, b, proc {diff(a, b)}
+ b = ISeq.iseq_load(b).to_a
+ assert_equal a, b, proc {diff(a, b)}
end
def test_next_in_block_in_block