diff options
author | Nobuyoshi Nakada <[email protected]> | 2021-06-03 12:32:44 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2021-06-03 15:11:18 +0900 |
commit | 37eb5e74395f148782f7d67b5218fb2e66b113d7 (patch) | |
tree | f92f0414ab29ff9ff6b6dca6a13b600574d165b0 /test/ruby/test_literal.rb | |
parent | a023db49bfbbbe119638bae6abf8113f0de371de (diff) |
Warn more duplicate literal hash keys
Following non-special_const literals:
* T_BIGNUM
* T_FLOAT (non-flonum)
* T_RATIONAL
* T_COMPLEX
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/4548
Diffstat (limited to 'test/ruby/test_literal.rb')
-rw-r--r-- | test/ruby/test_literal.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/ruby/test_literal.rb b/test/ruby/test_literal.rb index 10cb09b833..ed93b74cff 100644 --- a/test/ruby/test_literal.rb +++ b/test/ruby/test_literal.rb @@ -480,6 +480,10 @@ class TestRubyLiteral < Test::Unit::TestCase '"a"', '1000', '1.0', + '1_000_000_000_000_000_000_000', + '1.0r', + '1.0i', + '1.72723e-77', ) do |key| assert_warning(/key #{Regexp.quote(eval(key).inspect)} is duplicated/) do eval("{#{key} => :bar, #{key} => :foo}") |