mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-27 22:21:07 +03:00
parent
32471b57bd
commit
d90e37e0c6
442 changed files with 1426 additions and 2254 deletions
|
@ -184,7 +184,6 @@ func TestGetDottedRelativePath(t *testing.T) {
|
|||
for _, f := range []func(string) string{filepath.FromSlash, func(s string) string { return s }} {
|
||||
doTestGetDottedRelativePath(f, t)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func doTestGetDottedRelativePath(urlFixer func(string) string, t *testing.T) {
|
||||
|
@ -422,7 +421,6 @@ func createTempDirWithZeroLengthFiles() (string, error) {
|
|||
}
|
||||
// the dir now has one, zero length file in it
|
||||
return d, nil
|
||||
|
||||
}
|
||||
|
||||
func createTempDirWithNonZeroLengthFiles() (string, error) {
|
||||
|
@ -451,7 +449,6 @@ func createTempDirWithNonZeroLengthFiles() (string, error) {
|
|||
|
||||
// the dir now has one, zero length file in it
|
||||
return d, nil
|
||||
|
||||
}
|
||||
|
||||
func deleteTempDir(d string) {
|
||||
|
@ -490,7 +487,6 @@ func TestExists(t *testing.T) {
|
|||
t.Errorf("Test %d failed. Expected %q got %q", i, d.expectedErr, err)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func TestAbsPathify(t *testing.T) {
|
||||
|
@ -544,7 +540,6 @@ func TestAbsPathify(t *testing.T) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func TestExtNoDelimiter(t *testing.T) {
|
||||
|
@ -611,15 +606,12 @@ func TestFileAndExt(t *testing.T) {
|
|||
t.Errorf("Test %d failed. Expected extension %q got %q.", i, d.expectedExt, ext)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func TestPathPrep(t *testing.T) {
|
||||
|
||||
}
|
||||
|
||||
func TestPrettifyPath(t *testing.T) {
|
||||
|
||||
}
|
||||
|
||||
func TestExtractAndGroupRootPaths(t *testing.T) {
|
||||
|
@ -642,16 +634,19 @@ func TestExtractAndGroupRootPaths(t *testing.T) {
|
|||
|
||||
// Make sure the original is preserved
|
||||
c.Assert(in, qt.DeepEquals, inCopy)
|
||||
|
||||
}
|
||||
|
||||
func TestExtractRootPaths(t *testing.T) {
|
||||
tests := []struct {
|
||||
input []string
|
||||
expected []string
|
||||
}{{[]string{filepath.FromSlash("a/b"), filepath.FromSlash("a/b/c/"), "b",
|
||||
filepath.FromSlash("/c/d"), filepath.FromSlash("d/"), filepath.FromSlash("//e//")},
|
||||
[]string{"a", "a", "b", "c", "d", "e"}}}
|
||||
}{{
|
||||
[]string{
|
||||
filepath.FromSlash("a/b"), filepath.FromSlash("a/b/c/"), "b",
|
||||
filepath.FromSlash("/c/d"), filepath.FromSlash("d/"), filepath.FromSlash("//e//"),
|
||||
},
|
||||
[]string{"a", "a", "b", "c", "d", "e"},
|
||||
}}
|
||||
|
||||
for _, test := range tests {
|
||||
output := ExtractRootPaths(test.input)
|
||||
|
@ -667,7 +662,7 @@ func TestFindCWD(t *testing.T) {
|
|||
expectedErr error
|
||||
}
|
||||
|
||||
//cwd, _ := os.Getwd()
|
||||
// cwd, _ := os.Getwd()
|
||||
data := []test{
|
||||
//{cwd, nil},
|
||||
// Commenting this out. It doesn't work properly.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue