Move CaseTest
* test/ruby/enc/test_case_comprehensive.rb (CaseTest): move under the test case not to pollute the global name space. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55522 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
023aaa51a2
commit
ad72430863
@ -4,16 +4,6 @@
|
|||||||
require "test/unit"
|
require "test/unit"
|
||||||
require 'unicode_normalize/normalize' # only for UNICODE_VERSION
|
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
|
class TestComprehensiveCaseFold < Test::Unit::TestCase
|
||||||
UNICODE_VERSION = UnicodeNormalize::UNICODE_VERSION
|
UNICODE_VERSION = UnicodeNormalize::UNICODE_VERSION
|
||||||
UNICODE_DATA_PATH = "../../../enc/unicode/data/#{UNICODE_VERSION}"
|
UNICODE_DATA_PATH = "../../../enc/unicode/data/#{UNICODE_VERSION}"
|
||||||
@ -31,6 +21,12 @@ end
|
|||||||
File.exist?(TestComprehensiveCaseFold.expand_filename(f))
|
File.exist?(TestComprehensiveCaseFold.expand_filename(f))
|
||||||
} and
|
} and
|
||||||
class TestComprehensiveCaseFold
|
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)
|
def self.read_data_file (filename)
|
||||||
IO.foreach(expand_filename(filename), encoding: Encoding::ASCII_8BIT) do |line|
|
IO.foreach(expand_filename(filename), encoding: Encoding::ASCII_8BIT) do |line|
|
||||||
if $. == 1
|
if $. == 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user