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

ruby-changes:50918

From: nobu <ko1@a...>
Date: Mon, 9 Apr 2018 18:59:41 +0900 (JST)
Subject: [ruby-changes:50918] nobu:r63125 (trunk): test_literal.rb: use assert_syntax_error

nobu	2018-04-09 18:59:36 +0900 (Mon, 09 Apr 2018)

  New Revision: 63125

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

  Log:
    test_literal.rb: use assert_syntax_error

  Modified files:
    trunk/test/ruby/test_literal.rb
Index: test/ruby/test_literal.rb
===================================================================
--- test/ruby/test_literal.rb	(revision 63124)
+++ test/ruby/test_literal.rb	(revision 63125)
@@ -518,11 +518,7 @@ class TestRubyLiteral < Test::Unit::Test https://github.com/ruby/ruby/blob/trunk/test/ruby/test_literal.rb#L518
     bug2407 = '[ruby-dev:39798]'
     head.each {|h|
       if /^0/ =~ h
-        begin
-          eval("#{h}_")
-        rescue SyntaxError => e
-          assert_match(/numeric literal without digits\Z/, e.message, bug2407)
-        end
+        assert_syntax_error("#{h}_", /numeric literal without digits\Z/, "#{bug2407}: #{h.inspect}")
       end
     }
   end

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

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