File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ local function _normalize_path(filename, cwd)
8989 end
9090
9191 -- handles redundant `./` in the middle
92- local redundant = path .sep .. " ." .. path .sep
92+ local redundant = path .sep .. " % ." .. path .sep
9393 if filename :match (redundant ) then
9494 filename = filename :gsub (redundant , path .sep )
9595 end
Original file line number Diff line number Diff line change @@ -168,6 +168,12 @@ describe("Path", function()
168168 end )
169169
170170 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+
171177 it (" can take paths with double separators change them to single separators" , function ()
172178 local orig = " /lua//plenary/path.lua"
173179 local final = Path :new (orig ):normalize ()
You can’t perform that action at this time.
0 commit comments