summaryrefslogtreecommitdiff
path: root/spec/ruby/core/hash/compare_by_identity_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/hash/compare_by_identity_spec.rb')
-rw-r--r--spec/ruby/core/hash/compare_by_identity_spec.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/spec/ruby/core/hash/compare_by_identity_spec.rb b/spec/ruby/core/hash/compare_by_identity_spec.rb
index 3804f04bf6..2975526a97 100644
--- a/spec/ruby/core/hash/compare_by_identity_spec.rb
+++ b/spec/ruby/core/hash/compare_by_identity_spec.rb
@@ -110,6 +110,10 @@ describe "Hash#compare_by_identity" do
@idh.keys.first.should equal foo
end
+ # Check `#[]=` call with a String literal.
+ # Don't use `#+` because with `#+` it's no longer a String literal.
+ #
+ # See https://bugs.ruby-lang.org/issues/12855
it "gives different identity for string literals" do
eval <<~RUBY
# frozen_string_literal: false