summaryrefslogtreecommitdiff
path: root/test/ripper/test_parser_events.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-05-13 02:13:43 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-05-13 02:13:43 +0000
commit60730d91ce235dec66016001444b50d7131f0e10 (patch)
treed3bc115cbc4522fea0649888d0bb1185068bfc8c /test/ripper/test_parser_events.rb
parent5b80ca1db8df9a4368ce1412bad28c823a6e3c8b (diff)
parse.y: refine message for gvar w/o identitirs
* parse.y (parse_gvar): separate message for gvar without non-space characters from message for invalid identitirs. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50480 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ripper/test_parser_events.rb')
-rw-r--r--test/ripper/test_parser_events.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/ripper/test_parser_events.rb b/test/ripper/test_parser_events.rb
index 08296a2..6f1fc92 100644
--- a/test/ripper/test_parser_events.rb
+++ b/test/ripper/test_parser_events.rb
@@ -1219,14 +1219,17 @@ class TestRipper::ParserEvents < Test::Unit::TestCase
def test_invalid_instance_variable_name
assert_equal("`@1' is not allowed as an instance variable name", compile_error('@1'))
assert_equal("`@%' is not allowed as an instance variable name", compile_error('@%'))
+ assert_equal("`@' without identifiers is not allowed as an instance variable name", compile_error('@'))
end
def test_invalid_class_variable_name
assert_equal("`@@1' is not allowed as a class variable name", compile_error('@@1'))
assert_equal("`@@%' is not allowed as a class variable name", compile_error('@@%'))
+ assert_equal("`@@' without identifiers is not allowed as a class variable name", compile_error('@@'))
end
def test_invalid_global_variable_name
assert_equal("`$%' is not allowed as a global variable name", compile_error('$%'))
+ assert_equal("`$' without identifiers is not allowed as a global variable name", compile_error('$'))
end
end if ripper_test