From 8d83fcef473c57b2086ee00eb0acfb60191786bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Rosick=C3=BD?= Date: Thu, 5 Oct 2023 02:27:13 +0200 Subject: [PATCH] fnmatch not matching glob syntax --- core/file/shared/fnmatch.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/file/shared/fnmatch.rb b/core/file/shared/fnmatch.rb index e5446b6a5..db4b5c5d8 100644 --- a/core/file/shared/fnmatch.rb +++ b/core/file/shared/fnmatch.rb @@ -126,6 +126,13 @@ end end + it "matches wildcard with characters when flags includes FNM_PATHNAME" do + File.send(@method, '*a', 'aa', File::FNM_PATHNAME).should == true + File.send(@method, 'a*', 'aa', File::FNM_PATHNAME).should == true + File.send(@method, 'a*', 'aaa', File::FNM_PATHNAME).should == true + File.send(@method, '*a', 'aaa', File::FNM_PATHNAME).should == true + end + it "does not match '/' characters with ? or * when flags includes FNM_PATHNAME" do File.send(@method, '?', '/', File::FNM_PATHNAME).should == false File.send(@method, '*', '/', File::FNM_PATHNAME).should == false