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

ruby-changes:43673

From: duerst <ko1@a...>
Date: Tue, 26 Jul 2016 13:05:13 +0900 (JST)
Subject: [ruby-changes:43673] duerst:r55746 (trunk): * test/ruby/enc/test_case_comprehensive.rb: Add explicit skip test for

duerst	2016-07-26 13:05:03 +0900 (Tue, 26 Jul 2016)

  New Revision: 55746

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

  Log:
    * test/ruby/enc/test_case_comprehensive.rb: Add explicit skip test for
      availability of Unicode data files.

  Modified files:
    trunk/ChangeLog
    trunk/test/ruby/enc/test_case_comprehensive.rb
Index: test/ruby/enc/test_case_comprehensive.rb
===================================================================
--- test/ruby/enc/test_case_comprehensive.rb	(revision 55745)
+++ test/ruby/enc/test_case_comprehensive.rb	(revision 55746)
@@ -14,12 +14,21 @@ class TestComprehensiveCaseFold < Test:: https://github.com/ruby/ruby/blob/trunk/test/ruby/enc/test_case_comprehensive.rb#L14
   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
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 55745)
+++ ChangeLog	(revision 55746)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Tue Jul 26 13:04:59 2016  Martin Duerst  <duerst@i...>
+
+	* 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@r...>
 
 	* range.c (check_step_domain): check step argument domain by <=>

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

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