-
-
Notifications
You must be signed in to change notification settings - Fork 925
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 9.4.12.0
- 9.4.11.0
- 9.4.10.0
- 9.4.9.0
- 9.4.8.0
- 9.4.7.0
- 9.4.6.0
- 9.4.5.0
- 9.4.4.0
- 9.4.3.0
- 9.4.2.0
- 9.4.1.0
- 9.4.0.0
- 9.3.15.0
- 9.3.14.0
- 9.3.13.0
- 9.3.12.0
- 9.3.11.0
- 9.3.10.0
- 9.3.9.0
- 9.3.8.0
- 9.3.7.0
- 9.3.6.0
- 9.3.5.0
- 9.3.4.0
- 9.3.3.0
- 9.3.2.0
- 9.3.1.0
- 9.3.0.0
- 9.2.21.0
- 9.2.20.1
- 9.2.20.0
- 9.2.19.0
- 9.2.18.0
- 9.2.17.0
- 9.2.16.0
- 9.2.15.0
- 9.2.14.0
- 9.2.13.0
- 9.2.12.0
- 9.2.11.1
- 9.2.11.0
- 9.2.10.0
- 9.2.9.0
- 9.2.8.0
- 9.2.7.0
- 9.2.6.0
- 9.2.5.0
- 9.2.4.1
- 9.2.4.0
- 9.2.3.0
- 9.2.2.0
- 9.2.1.0
- 9.2.0.0
- 9.1.17.0
- 9.1.16.0
- 9.1.15.0
- 9.1.14.0
- 9.1.13.0
- 9.1.12.0
- 9.1.11.0
- 9.1.10.0
- 9.1.9.0
- 9.1.8.0
- 9.1.7.0
- 9.1.6.0
- 9.1.5.0
- 9.1.4.0
- 9.1.3.0
- 9.1.2.0
- 9.1.1.0
- 9.1.0.0
- 9.0.5.0
- 9.0.4.0
- 9.0.3.0
- 9.0.1.0
- 9.0.0.0
- 9.0.0.0.rc2
- 9.0.0.0.rc1
- 9.0.0.0.pre2
- 9.0.0.0.pre1
Showing
239 changed files
with
4,314 additions
and
1,506 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
require 'test/unit' | ||
require_relative '../../ruby/envutil' | ||
|
||
module Bug | ||
class TestException < Test::Unit::TestCase | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
require 'test/unit' | ||
require_relative '../../ruby/envutil' | ||
|
||
module Bug | ||
class Bug7802 < RuntimeError | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
require 'test/unit' | ||
|
||
class TestIseqLoad < Test::Unit::TestCase | ||
require '-test-/iseq_load/iseq_load' | ||
ISeq = RubyVM::InstructionSequence | ||
|
||
def test_bug8543 | ||
assert_iseq_roundtrip <<-'end;' | ||
puts "tralivali" | ||
def funct(a, b) | ||
a**b | ||
end | ||
3.times { |i| puts "Hello, world#{funct(2,i)}!" } | ||
end; | ||
end | ||
|
||
def test_case_when | ||
assert_iseq_roundtrip <<-'end;' | ||
def user_mask(target) | ||
target.each_char.inject(0) do |mask, chr| | ||
case chr | ||
when "u" | ||
mask | 04700 | ||
when "g" | ||
mask | 02070 | ||
when "o" | ||
mask | 01007 | ||
when "a" | ||
mask | 07777 | ||
else | ||
raise ArgumentError, "invalid `who' symbol in file mode: #{chr}" | ||
end | ||
end | ||
end | ||
end; | ||
end | ||
|
||
def test_splatsplat | ||
assert_iseq_roundtrip('def splatsplat(**); end') | ||
end | ||
|
||
def test_hidden | ||
assert_iseq_roundtrip('def x(a, (b, *c), d: false); end') | ||
end | ||
|
||
def assert_iseq_roundtrip(src) | ||
a = ISeq.compile(src).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_next_in_block_in_block | ||
skip "failing due to stack_max mismatch" | ||
assert_iseq_roundtrip <<-'end;' | ||
3.times { 3.times { next } } | ||
end; | ||
end | ||
|
||
def test_break_ensure | ||
skip "failing due to exception entry sp mismatch" | ||
assert_iseq_roundtrip <<-'end;' | ||
def m | ||
bad = true | ||
while true | ||
begin | ||
break | ||
ensure | ||
bad = false | ||
end | ||
end | ||
end | ||
end; | ||
end | ||
|
||
# FIXME: still failing | ||
def test_require_integration | ||
skip "iseq loader require integration tests still failing" | ||
f = File.expand_path(__FILE__) | ||
# $(top_srcdir)/test/ruby/test_....rb | ||
3.times { f = File.dirname(f) } | ||
Dir[File.join(f, 'ruby', '*.rb')].each do |f| | ||
iseq = ISeq.compile_file(f) | ||
orig = iseq.to_a.freeze | ||
|
||
loaded = ISeq.iseq_load(orig).to_a | ||
if loaded != orig | ||
warn f | ||
warn diff(orig, loaded) | ||
end | ||
#assert_equal orig, loaded | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
require 'test/unit' | ||
require_relative '../../ruby/envutil' | ||
require '-test-/marshal/usr' | ||
|
||
module Bug end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
require 'test/unit' | ||
require '-test-/proc' | ||
|
||
class TestProc < Test::Unit::TestCase | ||
class TestBMethod < Test::Unit::TestCase | ||
end | ||
end | ||
|
||
class TestProc::TestBMethod | ||
class Base | ||
def foo(*a) | ||
a | ||
end | ||
end | ||
|
||
class Bound < Base | ||
define_method(:foo, Bug::Proc.make_call_super(42)) | ||
define_method(:receiver, Bug::Proc.make_call_receiver(nil)) | ||
end | ||
|
||
def test_super_in_bmethod | ||
obj = Bound.new | ||
assert_equal([1, 42], obj.foo(1)) | ||
end | ||
|
||
def test_block_super | ||
obj = Bound.new | ||
result = nil | ||
obj.foo(2) {|*a| result = a} | ||
assert_equal([2, 42], result) | ||
end | ||
|
||
def test_receiver_in_bmethod | ||
obj = Bound.new | ||
assert_same(obj, obj.receiver) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.