From fb1059312d2a40e6437853ad2e40049d55308860 Mon Sep 17 00:00:00 2001 From: duerst Date: Sat, 28 Jul 2018 08:56:59 +0000 Subject: [PATCH] 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 --- test/test_unicode_normalize.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/test_unicode_normalize.rb b/test/test_unicode_normalize.rb index 347741dcb2..35ce337338 100644 --- a/test/test_unicode_normalize.rb +++ b/test/test_unicode_normalize.rb @@ -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