mirror of
https://github.com/ruby/ruby.git
synced 2025-08-26 22:45:03 +02:00
Signal.list deduplicates keys
This allows us to reuse string objects used in symbols as well as any string representations of signal names in source code. * signal.c (sig_list): use fstring for hash key * test/ruby/test_signal.rb (test_signal_list_dedupe_keys): added git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53657 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a52be8fb8f
commit
667c0a3a8c
3 changed files with 12 additions and 1 deletions
|
@ -301,4 +301,10 @@ EOS
|
|||
assert_ruby_status(['-e', 'Process.kill(:CONT, $$)'])
|
||||
end
|
||||
end if Process.respond_to?(:kill)
|
||||
|
||||
def test_signal_list_dedupe_keys
|
||||
a = Signal.list.keys.map(&:object_id).sort
|
||||
b = Signal.list.keys.map(&:object_id).sort
|
||||
assert_equal a, b
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue