aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_syntax.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-06-11 02:09:00 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-06-11 15:22:16 +0900
commit140b8117bd3c32cb9d0b144937b90f0178a00b0e (patch)
tree6465f881f123b2e8243d18b7630d010d2ba71654 /test/ruby/test_syntax.rb
parent42ac8890efbd38dc021bf5edab325a69be7fc4cf (diff)
downloadruby-140b8117bd3c32cb9d0b144937b90f0178a00b0e.tar.gz
&. is not allowed inside LHS of massign
https://hackerone.com/reports/605262
Diffstat (limited to 'test/ruby/test_syntax.rb')
-rw-r--r--test/ruby/test_syntax.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb
index 6fdca37924..8112b14690 100644
--- a/test/ruby/test_syntax.rb
+++ b/test/ruby/test_syntax.rb
@@ -976,6 +976,11 @@ eom
assert_valid_syntax("a\n.:foo")
end
+ def test_safe_call_in_massign_lhs
+ assert_syntax_error("*a&.x=0", /LHS/)
+ assert_syntax_error("a&.x,=0", /LHS/)
+ end
+
def test_no_warning_logop_literal
assert_warning("") do
eval("true||raise;nil")