github.com/vipernet-xyz/tm@v0.34.24/test/e2e/generator/random_test.go (about)

     1  package main
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/stretchr/testify/assert"
     7  )
     8  
     9  func TestCombinations(t *testing.T) {
    10  	input := map[string][]interface{}{
    11  		"bool":   {false, true},
    12  		"int":    {1, 2, 3},
    13  		"string": {"foo", "bar"},
    14  	}
    15  
    16  	c := combinations(input)
    17  	assert.Equal(t, []map[string]interface{}{
    18  		{"bool": false, "int": 1, "string": "foo"},
    19  		{"bool": false, "int": 1, "string": "bar"},
    20  		{"bool": false, "int": 2, "string": "foo"},
    21  		{"bool": false, "int": 2, "string": "bar"},
    22  		{"bool": false, "int": 3, "string": "foo"},
    23  		{"bool": false, "int": 3, "string": "bar"},
    24  		{"bool": true, "int": 1, "string": "foo"},
    25  		{"bool": true, "int": 1, "string": "bar"},
    26  		{"bool": true, "int": 2, "string": "foo"},
    27  		{"bool": true, "int": 2, "string": "bar"},
    28  		{"bool": true, "int": 3, "string": "foo"},
    29  		{"bool": true, "int": 3, "string": "bar"},
    30  	}, c)
    31  }