[前][次][番号順一覧][スレッド一覧]

ruby-changes:21377

From: nobu <ko1@a...>
Date: Fri, 7 Oct 2011 20:29:48 +0900 (JST)
Subject: [ruby-changes:21377] nobu:r33426 (trunk): * test/-ext-/symbol/test_inadvertent_creation.rb (noninterned_name):

nobu	2011-10-07 20:29:37 +0900 (Fri, 07 Oct 2011)

  New Revision: 33426

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=33426

  Log:
    * test/-ext-/symbol/test_inadvertent_creation.rb (noninterned_name):
      sigil of global, instance and class variable names should be
      followed by non-numeric.

  Modified files:
    trunk/test/-ext-/symbol/test_inadvertent_creation.rb

Index: test/-ext-/symbol/test_inadvertent_creation.rb
===================================================================
--- test/-ext-/symbol/test_inadvertent_creation.rb	(revision 33425)
+++ test/-ext-/symbol/test_inadvertent_creation.rb	(revision 33426)
@@ -3,8 +3,8 @@
 
 module Test_Symbol
   class TestInadvertent < Test::Unit::TestCase
-    def noninterned_name(prefix = "_")
-      prefix += Thread.current.object_id.to_s(36)
+    def noninterned_name(prefix = "")
+      prefix += "_#{Thread.current.object_id.to_s(36)}"
       begin
         name = "#{prefix}_#{rand(0x1000).to_s(16)}_#{Time.now.usec}"
       end while Bug::Symbol.interned?(name)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]