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

test_iseq.rb: shorten

* test/ruby/test_iseq.rb (TestISeq): use the utility method to get
  rid of warnings and the alias to shorten.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54188 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2016-03-19 02:49:21 +00:00
parent 4eb908d21a
commit 22198f9d3c

View file

@ -10,7 +10,7 @@ class TestISeq < Test::Unit::TestCase
def compile(src, line = nil, opt = nil)
EnvUtil.suppress_warning do
RubyVM::InstructionSequence.new(src, __FILE__, __FILE__, line, opt)
ISeq.new(src, __FILE__, __FILE__, line, opt)
end
end
@ -52,9 +52,9 @@ class TestISeq < Test::Unit::TestCase
end
def test_unsupport_type
ary = RubyVM::InstructionSequence.compile("p").to_a
ary = compile("p").to_a
ary[9] = :foobar
assert_raise_with_message(TypeError, /:foobar/) {RubyVM::InstructionSequence.load(ary)}
assert_raise_with_message(TypeError, /:foobar/) {ISeq.load(ary)}
end if defined?(RubyVM::InstructionSequence.load)
def test_loaded_cdhash_mark
@ -98,7 +98,7 @@ class TestISeq < Test::Unit::TestCase
end
def test_line_trace
iseq = ISeq.compile \
iseq = compile \
%q{ a = 1
b = 2
c = 3
@ -163,9 +163,9 @@ class TestISeq < Test::Unit::TestCase
def test_invalid_source
bug11159 = '[ruby-core:69219] [Bug #11159]'
assert_raise(TypeError, bug11159) {ISeq.compile(nil)}
assert_raise(TypeError, bug11159) {ISeq.compile(:foo)}
assert_raise(TypeError, bug11159) {ISeq.compile(1)}
assert_raise(TypeError, bug11159) {compile(nil)}
assert_raise(TypeError, bug11159) {compile(:foo)}
assert_raise(TypeError, bug11159) {compile(1)}
end
def test_frozen_string_literal_compile_option