Remove all unused variables and functions (#5823)

This commit is contained in:
Harshavardhana
2018-04-15 06:56:04 -07:00
committed by Nitish Tiwari
parent 97a8d856b6
commit adf9a9d300
14 changed files with 29 additions and 99 deletions

View File

@@ -18,7 +18,6 @@ package cmd
import (
"net/url"
"strings"
"testing"
)
@@ -189,38 +188,3 @@ func TestGetObjectsResources(t *testing.T) {
}
}
}
// Validates if filter values are correct
func TestValidateFilterValues(t *testing.T) {
testCases := []struct {
values []string
expectedError APIErrorCode
}{
{
values: []string{""},
expectedError: ErrNone,
},
{
values: []string{"", "prefix"},
expectedError: ErrNone,
},
{
values: []string{strings.Repeat("a", 1025)},
expectedError: ErrFilterValueInvalid,
},
{
values: []string{"a\\b"},
expectedError: ErrFilterValueInvalid,
},
{
values: []string{string([]byte{0xff, 0xfe, 0xfd})},
expectedError: ErrFilterValueInvalid,
},
}
for i, testCase := range testCases {
if actualError := validateFilterValues(testCase.values); actualError != testCase.expectedError {
t.Errorf("Test %d: Expected %d, got %d", i+1, testCase.expectedError, actualError)
}
}
}