mirror of
https://github.com/Icinga/icingadb.git
synced 2026-02-03 20:40:34 -05:00
31 lines
419 B
Go
31 lines
419 B
Go
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)
|
|
}
|