Avoid pointer based copy, instead use Clone() (#8547)

This PR adds functional test to test expanded
cluster syntax.
This commit is contained in:
Harshavardhana
2019-11-21 04:24:51 -08:00
committed by Nitish Tiwari
parent 9565641b9b
commit 4e9de58675
18 changed files with 198 additions and 165 deletions

View File

@@ -53,14 +53,17 @@ func TestCreateServerEndpoints(t *testing.T) {
{":9001", []string{"http://localhost:9001/export{01...64}"}, true},
}
for i, testCase := range testCases {
_, _, err := createServerEndpoints(testCase.serverAddr, testCase.args...)
if err != nil && testCase.success {
t.Errorf("Test %d: Expected success but failed instead %s", i+1, err)
}
if err == nil && !testCase.success {
t.Errorf("Test %d: Expected failure but passed instead", i+1)
}
for _, testCase := range testCases {
testCase := testCase
t.Run("", func(t *testing.T) {
_, _, _, err := createServerEndpoints(testCase.serverAddr, testCase.args...)
if err != nil && testCase.success {
t.Errorf("Expected success but failed instead %s", err)
}
if err == nil && !testCase.success {
t.Errorf("Expected failure but passed instead")
}
})
}
}