update unicode data files directory for normalization tests

* test/test_unicode_normalize.rb: search ucd directory
  first if it exists. This change follows r61415.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
duerst 2018-07-28 08:56:59 +00:00
Родитель 3943dcd180
Коммит fb1059312d
1 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -9,10 +9,11 @@ require 'unicode_normalize/normalize'
class TestUnicodeNormalize < Test::Unit::TestCase
UNICODE_VERSION = RbConfig::CONFIG['UNICODE_VERSION']
UNICODE_DATA_PATH = "../enc/unicode/data/#{UNICODE_VERSION}"
path = File.expand_path("../enc/unicode/data/#{UNICODE_VERSION}", __dir__)
UNICODE_DATA_PATH = File.directory?("#{path}/ucd") ? "#{path}/ucd" : path
def self.expand_filename(basename)
File.expand_path("#{UNICODE_DATA_PATH}/#{basename}.txt", __dir__)
File.expand_path("#{basename}.txt", UNICODE_DATA_PATH)
end
end