[前][次][番号順一覧][スレッド一覧]

ruby-changes:42114

From: nobu <ko1@a...>
Date: Sat, 19 Mar 2016 11:49:28 +0900 (JST)
Subject: [ruby-changes:42114] nobu:r54188 (trunk): test_iseq.rb: shorten

nobu	2016-03-19 11:49:21 +0900 (Sat, 19 Mar 2016)

  New Revision: 54188

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=54188

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

  Modified files:
    trunk/test/ruby/test_iseq.rb
Index: test/ruby/test_iseq.rb
===================================================================
--- test/ruby/test_iseq.rb	(revision 54187)
+++ test/ruby/test_iseq.rb	(revision 54188)
@@ -10,7 +10,7 @@ class TestISeq < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_iseq.rb#L10
 
   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 https://github.com/ruby/ruby/blob/trunk/test/ruby/test_iseq.rb#L52
   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 https://github.com/ruby/ruby/blob/trunk/test/ruby/test_iseq.rb#L98
   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 https://github.com/ruby/ruby/blob/trunk/test/ruby/test_iseq.rb#L163
 
   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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]