summaryrefslogtreecommitdiffstats
path: root/tests/internal/utils/slice_test.go
blob: c8782267b569e37be1e719ded919c61753dab87f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package utils

import (
	"github.com/stretchr/testify/require"
	"testing"
)

func TestSliceSubsets(t *testing.T) {
	data := []string{
		"bla",
		"blub",
		"derp",
	}

	result := SliceSubsets(data...)

	expected := [][]string{
		nil,
		{"bla"},
		{"blub"},
		{"bla", "blub"},
		{"derp"},
		{"bla", "derp"},
		{"blub", "derp"},
		{"bla", "blub", "derp"},
	}

	require.Equal(t, expected, result)

	t.Logf("%#v", result)
}