summaryrefslogtreecommitdiff
path: root/test/ruby/test_parse.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_parse.rb')
-rw-r--r--test/ruby/test_parse.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/test/ruby/test_parse.rb b/test/ruby/test_parse.rb
index 0b3657f8a0..d21484f4b6 100644
--- a/test/ruby/test_parse.rb
+++ b/test/ruby/test_parse.rb
@@ -720,13 +720,15 @@ x = __ENCODING__
end
def test_invalid_instance_variable
- assert_raise(SyntaxError) { eval('@#') }
- assert_raise(SyntaxError) { eval('@') }
+ pattern = /without identifiers is not allowed as an instance variable name/
+ assert_raise_with_message(SyntaxError, pattern) { eval('@%') }
+ assert_raise_with_message(SyntaxError, pattern) { eval('@') }
end
def test_invalid_class_variable
- assert_raise(SyntaxError) { eval('@@1') }
- assert_raise(SyntaxError) { eval('@@') }
+ pattern = /without identifiers is not allowed as a class variable name/
+ assert_raise_with_message(SyntaxError, pattern) { eval('@@%') }
+ assert_raise_with_message(SyntaxError, pattern) { eval('@@') }
end
def test_invalid_char