summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2020-03-07 09:44:38 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2020-03-07 09:44:38 +0000
commit773b45bcc86861c30db135a2c558444ca7193761 (patch)
treee7146de54658bdf7d43fb53214ab7b5a15cc0ce0 /test
parentca74f62a3abfa13c353737c74624d3ef00777036 (diff)
merge revision(s) 6e6844320de989cb88a154e2ac75066ccea1bba2: [Backport #16619]
Fixed duplicated warning As `command_rhs` is always a "value expression", `command_asgn` does not need the same check. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_6@67839 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_parse.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_parse.rb b/test/ruby/test_parse.rb
index c7aeeecb61..24ca62a3f6 100644
--- a/test/ruby/test_parse.rb
+++ b/test/ruby/test_parse.rb
@@ -1198,6 +1198,12 @@ x = __ENCODING__
assert_valid_syntax('let () { m(a) do; end }')
end
+ def test_void_value_in_command_rhs
+ w = "void value expression"
+ ex = assert_syntax_error("x = return 1", w)
+ assert_equal(1, ex.message.scan(w).size, "same #{w.inspect} warning should be just once")
+ end
+
=begin
def test_past_scope_variable
assert_warning(/past scope/) {catch {|tag| eval("BEGIN{throw tag}; tap {a = 1}; a")}}