summaryrefslogtreecommitdiff
path: root/test/ruby/test_literal.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-06-03 12:32:44 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-06-03 15:11:18 +0900
commit37eb5e74395f148782f7d67b5218fb2e66b113d7 (patch)
treef92f0414ab29ff9ff6b6dca6a13b600574d165b0 /test/ruby/test_literal.rb
parenta023db49bfbbbe119638bae6abf8113f0de371de (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.rb4
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}")