summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorduerst <duerst@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-07-26 04:05:03 +0000
committerduerst <duerst@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-07-26 04:05:03 +0000
commitc2b500a000a8128cd1886c6c7b0f7f19eed9fce0 (patch)
treecad405c76d54a05394884cab81648d837999ece4
parent706534b5f5760c2a36f641918cad94bcb3f8cb3d (diff)
* test/ruby/enc/test_case_comprehensive.rb: Add explicit skip test for
availability of Unicode data files. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55746 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--test/ruby/enc/test_case_comprehensive.rb17
2 files changed, 18 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 11e4246a59..01b455429f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Jul 26 13:04:59 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * test/ruby/enc/test_case_comprehensive.rb: Add explicit skip test for
+ availability of Unicode data files.
+
Mon Jul 25 21:33:13 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
* range.c (check_step_domain): check step argument domain by <=>
diff --git a/test/ruby/enc/test_case_comprehensive.rb b/test/ruby/enc/test_case_comprehensive.rb
index 40f4327e63..2b93692317 100644
--- a/test/ruby/enc/test_case_comprehensive.rb
+++ b/test/ruby/enc/test_case_comprehensive.rb
@@ -14,12 +14,21 @@ class TestComprehensiveCaseFold < Test::Unit::TestCase
def self.expand_filename(basename)
File.expand_path("#{UNICODE_DATA_PATH}/#{basename}.txt", __dir__)
end
+
+ def self.data_files_available?
+ %w[UnicodeData CaseFolding SpecialCasing].all? do |f|
+ File.exist?(expand_filename(f))
+ end
+ end
+
+ def test_data_files_available
+ unless TestComprehensiveCaseFold.data_files_available?
+ skip "Unicode data files not available in #{UNICODE_DATA_PATH}."
+ end
+ end
end
-%w[UnicodeData CaseFolding SpecialCasing].all? {|f|
- File.exist?(TestComprehensiveCaseFold.expand_filename(f))
-} and
-class TestComprehensiveCaseFold
+TestComprehensiveCaseFold.data_files_available? 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