Skip to content

Commit

Permalink
fnmatch not matching glob syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
ahorek authored and eregon committed Oct 30, 2023
1 parent 16713ee commit 8d83fce
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions core/file/shared/fnmatch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8d83fce

Please sign in to comment.