mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-24 21:56:05 +02:00
Run gofmt -s
This commit is contained in:
@@ -37,8 +37,8 @@ func TestComplement(t *testing.T) {
|
||||
|
||||
ns := New(&deps.Deps{})
|
||||
|
||||
s1 := []TstX{TstX{A: "a"}, TstX{A: "b"}, TstX{A: "d"}, TstX{A: "e"}}
|
||||
s2 := []TstX{TstX{A: "b"}, TstX{A: "e"}}
|
||||
s1 := []TstX{{A: "a"}, {A: "b"}, {A: "d"}, {A: "e"}}
|
||||
s2 := []TstX{{A: "b"}, {A: "e"}}
|
||||
|
||||
xa, xb, xd, xe := &StructWithSlice{A: "a"}, &StructWithSlice{A: "b"}, &StructWithSlice{A: "d"}, &StructWithSlice{A: "e"}
|
||||
|
||||
@@ -58,15 +58,15 @@ func TestComplement(t *testing.T) {
|
||||
{[]interface{}{"a", "b", nil}, []interface{}{[]string{"a", "d"}}, []interface{}{"b", nil}},
|
||||
{[]int{1, 2, 3, 4, 5}, []interface{}{[]int{1, 3}, []string{"a", "b"}, []int{1, 2}}, []int{4, 5}},
|
||||
{[]int{1, 2, 3, 4, 5}, []interface{}{[]int64{1, 3}}, []int{2, 4, 5}},
|
||||
{s1, []interface{}{s2}, []TstX{TstX{A: "a"}, TstX{A: "d"}}},
|
||||
{s1, []interface{}{s2}, []TstX{{A: "a"}, {A: "d"}}},
|
||||
{sp1, []interface{}{sp2}, []*StructWithSlice{xa, xd}},
|
||||
{sp1_2, []interface{}{sp2_2}, StructWithSlicePointers{xa, xd}},
|
||||
|
||||
// Errors
|
||||
{[]string{"a", "b", "c"}, []interface{}{"error"}, false},
|
||||
{"error", []interface{}{[]string{"c", "d"}, []string{"a", "b"}}, false},
|
||||
{[]string{"a", "b", "c"}, []interface{}{[][]string{[]string{"c", "d"}}}, false},
|
||||
{[]interface{}{[][]string{[]string{"c", "d"}}}, []interface{}{[]string{"c", "d"}, []string{"a", "b"}}, false},
|
||||
{[]string{"a", "b", "c"}, []interface{}{[][]string{{"c", "d"}}}, false},
|
||||
{[]interface{}{[][]string{{"c", "d"}}}, []interface{}{[]string{"c", "d"}, []string{"a", "b"}}, false},
|
||||
} {
|
||||
|
||||
errMsg := fmt.Sprintf("[%d]", i)
|
||||
|
@@ -30,8 +30,8 @@ func TestSymDiff(t *testing.T) {
|
||||
|
||||
ns := New(&deps.Deps{})
|
||||
|
||||
s1 := []TstX{TstX{A: "a"}, TstX{A: "b"}}
|
||||
s2 := []TstX{TstX{A: "a"}, TstX{A: "e"}}
|
||||
s1 := []TstX{{A: "a"}, {A: "b"}}
|
||||
s2 := []TstX{{A: "a"}, {A: "e"}}
|
||||
|
||||
xa, xb, xd, xe := &StructWithSlice{A: "a"}, &StructWithSlice{A: "b"}, &StructWithSlice{A: "d"}, &StructWithSlice{A: "e"}
|
||||
|
||||
@@ -48,7 +48,7 @@ func TestSymDiff(t *testing.T) {
|
||||
{[]interface{}{"a", "b", nil}, []interface{}{"a"}, []interface{}{"b", nil}},
|
||||
{[]int{1, 2, 3}, []int{3, 4}, []int{1, 2, 4}},
|
||||
{[]int{1, 2, 3}, []int64{3, 4}, []int{1, 2, 4}},
|
||||
{s1, s2, []TstX{TstX{A: "b"}, TstX{A: "e"}}},
|
||||
{s1, s2, []TstX{{A: "b"}, {A: "e"}}},
|
||||
{sp1, sp2, []*StructWithSlice{xa, xd}},
|
||||
|
||||
// Errors
|
||||
|
@@ -74,8 +74,8 @@ func TestShortcodesTemplate(t *testing.T) {
|
||||
|
||||
s := &shortcodeTemplates{
|
||||
variants: []shortcodeVariant{
|
||||
shortcodeVariant{variants: []string{"a", "b", "c"}},
|
||||
shortcodeVariant{variants: []string{"a", "b", "d"}},
|
||||
{variants: []string{"a", "b", "c"}},
|
||||
{variants: []string{"a", "b", "d"}},
|
||||
},
|
||||
}
|
||||
|
||||
|
@@ -119,21 +119,21 @@ func TestUnmarshal(t *testing.T) {
|
||||
assert.Equal("Ford", first[1])
|
||||
}},
|
||||
{testContentResource{key: "r1", content: `a;b;c`, mime: media.CSVType}, map[string]interface{}{"delimiter": ";"}, func(r [][]string) {
|
||||
assert.Equal(r, [][]string{[]string{"a", "b", "c"}})
|
||||
assert.Equal(r, [][]string{{"a", "b", "c"}})
|
||||
|
||||
}},
|
||||
{"a,b,c", nil, func(r [][]string) {
|
||||
assert.Equal(r, [][]string{[]string{"a", "b", "c"}})
|
||||
assert.Equal(r, [][]string{{"a", "b", "c"}})
|
||||
|
||||
}},
|
||||
{"a;b;c", map[string]interface{}{"delimiter": ";"}, func(r [][]string) {
|
||||
assert.Equal(r, [][]string{[]string{"a", "b", "c"}})
|
||||
assert.Equal(r, [][]string{{"a", "b", "c"}})
|
||||
|
||||
}},
|
||||
{testContentResource{key: "r1", content: `
|
||||
% This is a comment
|
||||
a;b;c`, mime: media.CSVType}, map[string]interface{}{"DElimiter": ";", "Comment": "%"}, func(r [][]string) {
|
||||
assert.Equal(r, [][]string{[]string{"a", "b", "c"}})
|
||||
assert.Equal(r, [][]string{{"a", "b", "c"}})
|
||||
|
||||
}},
|
||||
// errors
|
||||
|
Reference in New Issue
Block a user