ruby-changes:33682
From: nobu <ko1@a...>
Date: Thu, 1 May 2014 00:16:13 +0900 (JST)
Subject: [ruby-changes:33682] nobu:r45763 (trunk): test_inadvertent_creation.rb: use Symbol.find
nobu 2014-05-01 00:16:07 +0900 (Thu, 01 May 2014) New Revision: 45763 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=45763 Log: test_inadvertent_creation.rb: use Symbol.find * ext/-test-/symbol/intern.c: Symbol.find is available now. * test/-ext-/symbol/test_inadvertent_creation.rb (noninterned_name): use Symbol.find instead. Removed files: trunk/ext/-test-/symbol/intern.c Modified files: trunk/test/-ext-/symbol/test_inadvertent_creation.rb Index: ext/-test-/symbol/intern.c =================================================================== --- ext/-test-/symbol/intern.c (revision 45762) +++ ext/-test-/symbol/intern.c (revision 45763) @@ -1,14 +0,0 @@ https://github.com/ruby/ruby/blob/trunk/ext/-test-/symbol/intern.c#L0 -#include "ruby.h" - -static VALUE -bug_sym_interned_p(VALUE self, VALUE name) -{ - ID id = rb_check_id(&name); - return id ? Qtrue : Qfalse; -} - -void -Init_intern(VALUE klass) -{ - rb_define_singleton_method(klass, "interned?", bug_sym_interned_p, 1); -} Index: test/-ext-/symbol/test_inadvertent_creation.rb =================================================================== --- test/-ext-/symbol/test_inadvertent_creation.rb (revision 45762) +++ test/-ext-/symbol/test_inadvertent_creation.rb (revision 45763) @@ -7,7 +7,7 @@ module Test_Symbol https://github.com/ruby/ruby/blob/trunk/test/-ext-/symbol/test_inadvertent_creation.rb#L7 prefix += "_#{Thread.current.object_id.to_s(36).tr('-', '_')}" begin name = "#{prefix}_#{rand(0x1000).to_s(16)}_#{Time.now.usec}" - end while Bug::Symbol.interned?(name) + end while ::Symbol.find(name) name end @@ -16,7 +16,7 @@ module Test_Symbol https://github.com/ruby/ruby/blob/trunk/test/-ext-/symbol/test_inadvertent_creation.rb#L16 end def assert_not_interned(name, msg = nil) - assert_not_send([Bug::Symbol, :interned?, name], msg) + assert_not_send([::Symbol, :find, name], msg) end def assert_not_interned_error(obj, meth, name, msg = nil) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/