From d4c3917249e6a8ec144d000399c4592fc52e35e9 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Thu, 26 Nov 2026 17:05:45 +0900 Subject: [PATCH] Expect TruffleRuby 40+ to omit ".." from DOTMATCH glob TruffleRuby 40.0.0 matches CRuby 3.1+ and no longer returns ".." from Pathname.glob("*", File::FNM_DOTMATCH), while 34.x still does. Co-Authored-By: Claude Opus 5.5 --- test/pathname/test_pathname.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/pathname/test_pathname.rb b/test/pathname/test_pathname.rb index c5b19c8..67bbeec 100644 --- a/test/pathname/test_pathname.rb +++ b/test/pathname/test_pathname.rb @@ -1347,8 +1347,9 @@ def test_s_glob end def test_s_glob_3args - # Note: truffleruby should behave like CRuby 3.1+, but it's not the case currently - expect = (RUBY_VERSION >= "3.1" && RUBY_ENGINE != "truffleruby") ? [Pathname("."), Pathname("f")] : [Pathname("."), Pathname(".."), Pathname("f")] + # TruffleRuby behaves like CRuby 3.1+ since 40.0 + no_dotdot = RUBY_ENGINE == "truffleruby" ? RUBY_ENGINE_VERSION >= "40" : RUBY_VERSION >= "3.1" + expect = no_dotdot ? [Pathname("."), Pathname("f")] : [Pathname("."), Pathname(".."), Pathname("f")] with_tmpchdir('rubytest-pathname') {|dir| open("f", "w") {|f| f.write "abc" } Dir.chdir("/") {