Skip to content

Commit

Permalink
Add spec for directory with many special characters.
Browse files Browse the repository at this point in the history
  • Loading branch information
aardvark179 authored and eregon committed Aug 29, 2022
1 parent a135506 commit d6a79c0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions core/dir/fixtures/common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ def self.mock_dir_files

special/test{1}/file[1]
special/{}/special
special/test\ +()[]{}/hello_world.erb
]

platform_is_not :windows do
Expand Down
2 changes: 2 additions & 0 deletions core/dir/glob_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
nested/
nested/.dotsubir/
special/
special/test\ +()[]{}/
special/test{1}/
special/{}/
subdir_one/
Expand Down Expand Up @@ -130,6 +131,7 @@
./nested/
./nested/.dotsubir/
./special/
./special/test\ +()[]{}/
./special/test{1}/
./special/{}/
./subdir_one/
Expand Down
5 changes: 5 additions & 0 deletions core/dir/shared/glob.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@
it "matches files with backslashes in their name" do
Dir.glob('special/\\\\{a,b}').should == ['special/\a']
end

it "matches directory with special characters in their name in complex patterns" do
Dir.glob("special/test +()\\[\\]\\{\\}/hello_world{.{en},}{.{html},}{+{phone},}{.{erb},}").should == ['special/test +()[]{}/hello_world.erb']
end
end

it "matches regexp special ^" do
Expand Down Expand Up @@ -225,6 +229,7 @@
dir/
nested/
special/
special/test\ +()[]{}/
special/test{1}/
special/{}/
subdir_one/
Expand Down

0 comments on commit d6a79c0

Please sign in to comment.