summaryrefslogtreecommitdiff
path: root/test/ruby/test_parse.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-03-17 05:21:18 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-03-17 05:21:18 +0000
commit12acc751e3e7fd6f8aec33abf661724ad76c862a (patch)
tree831705cd3fc725d9abb2909036867e6f13cd1df5 /test/ruby/test_parse.rb
parent0fa4a6a618295d42eb039c65f0609fdb71255355 (diff)
Numbered parameters [Feature #4475]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67278 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_parse.rb')
-rw-r--r--test/ruby/test_parse.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/ruby/test_parse.rb b/test/ruby/test_parse.rb
index d21484f4b6..dc4c143241 100644
--- a/test/ruby/test_parse.rb
+++ b/test/ruby/test_parse.rb
@@ -363,7 +363,7 @@ class TestParse < Test::Unit::TestCase
def test_dstr_disallowed_variable
bug8375 = '[ruby-core:54885] [Bug #8375]'
- %w[@ @1 @. @@ @@1 @@. $ $%].each do |src|
+ %w[@ @. @@ @@1 @@. $ $%].each do |src|
src = '#'+src+' '
str = assert_nothing_raised(SyntaxError, "#{bug8375} #{src.dump}") do
break eval('"'+src+'"')
@@ -378,15 +378,15 @@ class TestParse < Test::Unit::TestCase
def assert_disallowed_variable(type, noname, invalid)
noname.each do |name|
- assert_syntax_error("a = #{name}", "`#{noname[0]}' without identifiers is not allowed as #{type} variable name")
+ assert_syntax_error("proc{a = #{name} }", "`#{noname[0]}' without identifiers is not allowed as #{type} variable name")
end
invalid.each do |name|
- assert_syntax_error("a = #{name}", "`#{name}' is not allowed as #{type} variable name")
+ assert_syntax_error("proc {a = #{name} }", "`#{name}' is not allowed as #{type} variable name")
end
end
def test_disallowed_instance_variable
- assert_disallowed_variable("an instance", %w[@ @.], %w[@1])
+ assert_disallowed_variable("an instance", %w[@ @.], %w[])
end
def test_disallowed_class_variable