aboutsummaryrefslogtreecommitdiffhomepage
path: root/helpers/path_test.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2020-12-02 13:23:25 +0100
committerBjørn Erik Pedersen <[email protected]>2020-12-03 13:12:58 +0100
commitd90e37e0c6e812f9913bf256c9c81aa05b7a08aa (patch)
tree7b1b14464eefec1188ca2eed53c64e4823453cc9 /helpers/path_test.go
parent32471b57bde51c55a15dbf1db75d6e5f7232c347 (diff)
downloadhugo-d90e37e0c6e812f9913bf256c9c81aa05b7a08aa.tar.gz
hugo-d90e37e0c6e812f9913bf256c9c81aa05b7a08aa.zip
all: Format code with gofumpt
See https://github.com/mvdan/gofumpt
Diffstat (limited to 'helpers/path_test.go')
-rw-r--r--helpers/path_test.go21
1 files changed, 8 insertions, 13 deletions
diff --git a/helpers/path_test.go b/helpers/path_test.go
index 50c23dccc..e1ac90b2f 100644
--- a/helpers/path_test.go
+++ b/helpers/path_test.go
@@ -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.