Some checks are pending
docker-build-cometbft / vars (push) Waiting to run
docker-build-cometbft / build-images (amd64, ubuntu-24.04) (push) Blocked by required conditions
docker-build-cometbft / build-images (arm64, ubuntu-24.04-arm) (push) Blocked by required conditions
docker-build-cometbft / merge-images (push) Blocked by required conditions
docker-build-e2e-node / vars (push) Waiting to run
docker-build-e2e-node / build-images (amd64, ubuntu-24.04) (push) Blocked by required conditions
docker-build-e2e-node / build-images (arm64, ubuntu-24.04-arm) (push) Blocked by required conditions
docker-build-e2e-node / merge-images (push) Blocked by required conditions
31 lines
856 B
Go
31 lines
856 B
Go
package main
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestCombinations(t *testing.T) {
|
|
input := map[string][]interface{}{
|
|
"bool": {false, true},
|
|
"int": {1, 2, 3},
|
|
"string": {"foo", "bar"},
|
|
}
|
|
|
|
c := combinations(input)
|
|
assert.Equal(t, []map[string]interface{}{
|
|
{"bool": false, "int": 1, "string": "foo"},
|
|
{"bool": false, "int": 1, "string": "bar"},
|
|
{"bool": false, "int": 2, "string": "foo"},
|
|
{"bool": false, "int": 2, "string": "bar"},
|
|
{"bool": false, "int": 3, "string": "foo"},
|
|
{"bool": false, "int": 3, "string": "bar"},
|
|
{"bool": true, "int": 1, "string": "foo"},
|
|
{"bool": true, "int": 1, "string": "bar"},
|
|
{"bool": true, "int": 2, "string": "foo"},
|
|
{"bool": true, "int": 2, "string": "bar"},
|
|
{"bool": true, "int": 3, "string": "foo"},
|
|
{"bool": true, "int": 3, "string": "bar"},
|
|
}, c)
|
|
}
|