1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Suppress "statement not reached" warning

This commit is contained in:
Nobuyoshi Nakada 2019-06-30 09:56:30 +09:00
parent cc68084652
commit 75129c62eb
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60
2 changed files with 4 additions and 2 deletions

View file

@ -92,7 +92,9 @@ class TestIseqLoad < Test::Unit::TestCase
begin;
3.times { 3.times { next; @next_broke = true } }
end;
a = ISeq.compile(src, __FILE__, __FILE__, line).to_a
a = EnvUtil.suppress_warning {
ISeq.compile(src, __FILE__, __FILE__, line)
}.to_a
iseq = ISeq.iseq_load(a)
iseq.eval
assert_equal false, @next_broke

View file

@ -347,7 +347,7 @@ class TestRubyOptimization < Test::Unit::TestCase
def test_tailcall_inhibited_by_rescue
bug12082 = '[ruby-core:73871] [Bug #12082]'
tailcall("#{<<-"begin;"}\n#{<<~"end;"}")
EnvUtil.suppress_warning {tailcall("#{<<-"begin;"}\n#{<<~"end;"}")}
begin;
def to_be_rescued
return do_raise