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