mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-28 06:30:33 +03:00
Introduce FilepathPathBridge
This commit introduces the new interface FilepathPathBridge to remove some code that differs only in their use of either the path or filepath package.
This commit is contained in:
parent
5f9596e68c
commit
bedc2d8488
3 changed files with 85 additions and 37 deletions
|
@ -461,7 +461,7 @@ func TestFileAndExt(t *testing.T) {
|
|||
}
|
||||
|
||||
for i, d := range data {
|
||||
file, ext := FileAndExt(filepath.FromSlash(d.input))
|
||||
file, ext := FileAndExt(filepath.FromSlash(d.input), filepathBridge)
|
||||
if d.expectedFile != file {
|
||||
t.Errorf("Test %d failed. Expected filename %q got %q.", i, d.expectedFile, file)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue