diff options
Diffstat (limited to 'common/collections')
-rw-r--r-- | common/collections/append_test.go | 12 | ||||
-rw-r--r-- | common/collections/slice.go | 1 | ||||
-rw-r--r-- | common/collections/slice_test.go | 1 |
3 files changed, 7 insertions, 7 deletions
diff --git a/common/collections/append_test.go b/common/collections/append_test.go index 3c2aab2db..f791b731a 100644 --- a/common/collections/append_test.go +++ b/common/collections/append_test.go @@ -55,7 +55,7 @@ func TestAppend(t *testing.T) { []any{&tstSlicerIn1{"c"}}, testSlicerInterfaces{&tstSlicerIn1{"a"}, &tstSlicerIn1{"b"}, &tstSlicerIn1{"c"}}, }, - //https://github.com/gohugoio/hugo/issues/5361 + // https://github.com/gohugoio/hugo/issues/5361 { []string{"a", "b"}, []any{tstSlicers{&tstSlicer{"a"}, &tstSlicer{"b"}}}, @@ -102,14 +102,16 @@ func TestAppendToMultiDimensionalSlice(t *testing.T) { from []any expected any }{ - {[][]string{{"a", "b"}}, + { + [][]string{{"a", "b"}}, []any{[]string{"c", "d"}}, [][]string{ {"a", "b"}, {"c", "d"}, }, }, - {[][]string{{"a", "b"}}, + { + [][]string{{"a", "b"}}, []any{[]string{"c", "d"}, []string{"e", "f"}}, [][]string{ {"a", "b"}, @@ -117,7 +119,8 @@ func TestAppendToMultiDimensionalSlice(t *testing.T) { {"e", "f"}, }, }, - {[][]string{{"a", "b"}}, + { + [][]string{{"a", "b"}}, []any{[]int{1, 2}}, false, }, @@ -130,7 +133,6 @@ func TestAppendToMultiDimensionalSlice(t *testing.T) { c.Assert(result, qt.DeepEquals, test.expected) } } - } func TestAppendShouldMakeACopyOfTheInputSlice(t *testing.T) { diff --git a/common/collections/slice.go b/common/collections/slice.go index bf5c7b52b..731f489f9 100644 --- a/common/collections/slice.go +++ b/common/collections/slice.go @@ -73,7 +73,6 @@ func StringSliceToInterfaceSlice(ss []string) []any { result[i] = s } return result - } type SortedStringSlice []string diff --git a/common/collections/slice_test.go b/common/collections/slice_test.go index 5788b9161..20961aac0 100644 --- a/common/collections/slice_test.go +++ b/common/collections/slice_test.go @@ -135,5 +135,4 @@ func TestSortedStringSlice(t *testing.T) { c.Assert(s.Count("b"), qt.Equals, 3) c.Assert(s.Count("z"), qt.Equals, 0) c.Assert(s.Count("a"), qt.Equals, 1) - } |