summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-04-12 16:00:14 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-04-12 16:00:14 +0000
commit54eb4c1930f81998efe64661e1a6d82df915e9ba (patch)
treeb614dd8d71f7f250d7f642b34a605200b6147a37 /test
parent1cc6f36317558a48ccf05ff5758af0c4cd455b79 (diff)
merge revision(s) 49964,50265: [Backport #11047] [Backport #10957]
* parse.y (primary): empty parentheses at cmdarg can be null. [ruby-core:68477] [Bug #10957] * parse.y (arg): fix segfault by null caused by syntax error. [ruby-core:68851] [Bug #10957] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@50277 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_syntax.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb
index 86c1090c30..0274a11e83 100644
--- a/test/ruby/test_syntax.rb
+++ b/test/ruby/test_syntax.rb
@@ -557,6 +557,14 @@ eom
assert_syntax_error(src, /formal argument/, bug10545)
end
+ def test_null_range_cmdarg
+ bug10957 = '[ruby-core:68477] [Bug #10957]'
+ assert_ruby_status(['-c', '-e', 'p ()..0'], "", bug10957)
+ assert_ruby_status(['-c', '-e', 'p ()...0'], "", bug10957)
+ assert_syntax_error('0..%w.', /unterminated string/, bug10957)
+ assert_syntax_error('0...%w.', /unterminated string/, bug10957)
+ end
+
private
def not_label(x) @result = x; @not_label ||= nil end