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

ruby-changes:66786

From: Nobuyoshi <ko1@a...>
Date: Wed, 14 Jul 2021 22:41:30 +0900 (JST)
Subject: [ruby-changes:66786] 2fa3209a35 (master): [ruby/fiddle] fixed the test on case-insensitive filesystem

https://git.ruby-lang.org/ruby.git/commit/?id=2fa3209a35

From 2fa3209a350f21f31d65e0d85f9903244d40f8f1 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Wed, 14 Jul 2021 22:00:56 +0900
Subject: [ruby/fiddle] fixed the test on case-insensitive filesystem

---
 test/fiddle/test_handle.rb | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/test/fiddle/test_handle.rb b/test/fiddle/test_handle.rb
index 5c15173..b7c628c 100644
--- a/test/fiddle/test_handle.rb
+++ b/test/fiddle/test_handle.rb
@@ -113,9 +113,15 @@ module Fiddle https://github.com/ruby/ruby/blob/trunk/test/fiddle/test_handle.rb#L113
     end
 
     def test_file_name
-      handle = Handle.new(LIBC_SO)
-      assert_kind_of String, handle.file_name
-      assert_equal File.basename(handle.file_name), File.basename(LIBC_SO)
+      file_name = Handle.new(LIBC_SO).file_name
+      assert_kind_of String, file_name
+      expected = File.basename(LIBC_SO)
+      basename = File.basename(file_name)
+      if File::FNM_SYSCASE.zero?
+        assert_equal expected, basename
+      else
+        assert_send [basename, :casecmp?, expected]
+      end
     end unless /darwin/ =~ RUBY_PLATFORM
 
     def test_NEXT
-- 
cgit v1.1


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

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