File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ local function _normalize_path(filename, cwd)
89
89
end
90
90
91
91
-- handles redundant `./` in the middle
92
- local redundant = path .sep .. " ." .. path .sep
92
+ local redundant = path .sep .. " % ." .. path .sep
93
93
if filename :match (redundant ) then
94
94
filename = filename :gsub (redundant , path .sep )
95
95
end
Original file line number Diff line number Diff line change @@ -168,6 +168,12 @@ describe("Path", function()
168
168
end )
169
169
170
170
describe (" :normalize" , function ()
171
+ it (" can take path that has one character directories" , function ()
172
+ local orig = " /home/j/./p//path.lua"
173
+ local final = Path :new (orig ):normalize ()
174
+ assert .are .same (final , " /home/j/p/path.lua" )
175
+ end )
176
+
171
177
it (" can take paths with double separators change them to single separators" , function ()
172
178
local orig = " /lua//plenary/path.lua"
173
179
local final = Path :new (orig ):normalize ()
You can’t perform that action at this time.
0 commit comments