diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-02-10 12:15:48 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-02-10 14:00:40 +0900 |
commit | 6e6844320de989cb88a154e2ac75066ccea1bba2 (patch) | |
tree | 2d0637ada2b3d87ef5d1692fbc33c5e8db611481 /test | |
parent | 442c6de5546b233364c295155953cd0bc17e99e3 (diff) |
Fixed duplicated warning
As `command_rhs` is always a "value expression", `command_asgn`
does not need the same check.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/2897
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_parse.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_parse.rb b/test/ruby/test_parse.rb index cb379ebe18..1e909bce1b 100644 --- a/test/ruby/test_parse.rb +++ b/test/ruby/test_parse.rb @@ -1166,6 +1166,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")}} |