diff options
Diffstat (limited to 'test/ruby/test_parse.rb')
-rw-r--r-- | test/ruby/test_parse.rb | 8 |
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 |