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

ruby-changes:43448

From: nobu <ko1@a...>
Date: Tue, 28 Jun 2016 16:04:20 +0900 (JST)
Subject: [ruby-changes:43448] nobu:r55522 (trunk): Move CaseTest

nobu	2016-06-28 16:04:13 +0900 (Tue, 28 Jun 2016)

  New Revision: 55522

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=55522

  Log:
    Move CaseTest
    
    * test/ruby/enc/test_case_comprehensive.rb (CaseTest): move under
      the test case not to pollute the global name space.

  Modified files:
    trunk/test/ruby/enc/test_case_comprehensive.rb
Index: test/ruby/enc/test_case_comprehensive.rb
===================================================================
--- test/ruby/enc/test_case_comprehensive.rb	(revision 55521)
+++ test/ruby/enc/test_case_comprehensive.rb	(revision 55522)
@@ -4,16 +4,6 @@ https://github.com/ruby/ruby/blob/trunk/test/ruby/enc/test_case_comprehensive.rb#L4
 require "test/unit"
 require 'unicode_normalize/normalize'  # only for UNICODE_VERSION
 
-class CaseTest
-  attr_reader :method_name, :attributes, :first_data, :follow_data
-  def initialize(method_name, attributes, first_data, follow_data=first_data)
-    @method_name = method_name
-    @attributes  = attributes
-    @first_data  = first_data
-    @follow_data = follow_data
-  end
-end
-
 class TestComprehensiveCaseFold < Test::Unit::TestCase
   UNICODE_VERSION = UnicodeNormalize::UNICODE_VERSION
   UNICODE_DATA_PATH = "../../../enc/unicode/data/#{UNICODE_VERSION}"
@@ -31,6 +21,12 @@ end https://github.com/ruby/ruby/blob/trunk/test/ruby/enc/test_case_comprehensive.rb#L21
   File.exist?(TestComprehensiveCaseFold.expand_filename(f))
 } and
 class TestComprehensiveCaseFold
+  (CaseTest = Struct.new(:method_name, :attributes, :first_data, :follow_data)).class_eval do
+    def initialize(method_name, attributes, first_data, follow_data=first_data)
+      super
+    end
+  end
+
   def self.read_data_file (filename)
     IO.foreach(expand_filename(filename), encoding: Encoding::ASCII_8BIT) do |line|
       if $. == 1

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

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