summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-04-09 11:09:30 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-04-09 11:09:30 +0000
commit6a571272227b0093a1b0fa82225ebde04ce1a69b (patch)
tree9f09c421a36b160d14e92d28137a59e71ee14715 /test/ruby
parent066af25b58af97cc0b07773dd11b9a3aa55d40bf (diff)
parse.y: extra error message after no digits
* parse.y (no_digits): return tINTEGER instead of unexpected end-of-input, to get rid of extra error messages. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63126 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_literal.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/ruby/test_literal.rb b/test/ruby/test_literal.rb
index f626e05397..3b6aa0c096 100644
--- a/test/ruby/test_literal.rb
+++ b/test/ruby/test_literal.rb
@@ -516,11 +516,12 @@ class TestRubyLiteral < Test::Unit::TestCase
}
}
bug2407 = '[ruby-dev:39798]'
- head.each {|h|
- if /^0/ =~ h
- assert_syntax_error("#{h}_", /numeric literal without digits\Z/, "#{bug2407}: #{h.inspect}")
+ head.grep_v(/^0/) do |s|
+ head.grep(/^0/) do |h|
+ h = "#{s}#{h}_"
+ assert_syntax_error(h, /numeric literal without digits\Z/, "#{bug2407}: #{h.inspect}")
end
- }
+ end
end
def test_float