Improved unit test (example close to actual value)

pull/4047/head
Pierre Souchay 2018-04-24 23:15:27 +02:00
parent 208566d541
commit 303997ff55
1 changed files with 1 additions and 3 deletions

View File

@ -49,8 +49,6 @@ func TestConfigFlagsAndEdgecases(t *testing.T) {
dataDir := testutil.TempDir(t, "consul") dataDir := testutil.TempDir(t, "consul")
defer os.RemoveAll(dataDir) defer os.RemoveAll(dataDir)
metaVal := make(map[string]string)
metaVal["my"] = "value"
tests := []configTest{ tests := []configTest{
// ------------------------------------------------------------ // ------------------------------------------------------------
// cmd line flags // cmd line flags
@ -1934,7 +1932,7 @@ func TestConfigFlagsAndEdgecases(t *testing.T) {
patch: func(rt *RuntimeConfig) { patch: func(rt *RuntimeConfig) {
rt.Services = []*structs.ServiceDefinition{ rt.Services = []*structs.ServiceDefinition{
&structs.ServiceDefinition{Name: "a", Port: 80}, &structs.ServiceDefinition{Name: "a", Port: 80},
&structs.ServiceDefinition{Name: "b", Port: 90, Meta: metaVal}, &structs.ServiceDefinition{Name: "b", Port: 90, Meta: map[string]string{"my": "value"}},
} }
rt.DataDir = dataDir rt.DataDir = dataDir
}, },