diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2021-10-08 00:10:32 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2021-10-08 00:11:22 +0900 |
commit | 8057129da61e7fc920b0cd1cb09105125819c10f (patch) | |
tree | be1abc8dd1e6be455219c4c6ae6e4912c480f38b /test/ruby/test_parse.rb | |
parent | 80e2242da6c4d7f1760cb08af72140e178642639 (diff) |
Remove duplicate value checks on `mrhs` which always has the value
Diffstat (limited to 'test/ruby/test_parse.rb')
-rw-r--r-- | test/ruby/test_parse.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/test/ruby/test_parse.rb b/test/ruby/test_parse.rb index a9e8417357..3120016e60 100644 --- a/test/ruby/test_parse.rb +++ b/test/ruby/test_parse.rb @@ -1231,10 +1231,12 @@ x = __ENCODING__ assert_valid_syntax('let () { m(a) do; end }') end - def test_void_value_in_command_rhs + def test_void_value_in_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") + ["x = return 1", "x = return, 1", "x = 1, return", "x, y = return"].each do |code| + ex = assert_syntax_error(code, w) + assert_equal(1, ex.message.scan(w).size, ->{"same #{w.inspect} warning should be just once\n#{w.message}"}) + end end def eval_separately(code) |