Vendor cleanup

Signed-off-by: Madhu Rajanna <mrajanna@redhat.com>
This commit is contained in:
Madhu Rajanna
2019-01-16 18:11:54 +05:30
parent 661818bd79
commit 0f836c62fa
16816 changed files with 20 additions and 4611100 deletions

View File

@ -1,52 +0,0 @@
/*
Copyright 2018 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package version
import (
"testing"
)
func TestCompareKubeAwareVersionStrings(t *testing.T) {
tests := []*struct {
v1, v2 string
expectedGreater bool
}{
{"v1", "v2", false},
{"v2", "v1", true},
{"v10", "v2", true},
{"v1", "v2alpha1", true},
{"v1", "v2beta1", true},
{"v1alpha2", "v1alpha1", true},
{"v1beta1", "v2alpha3", true},
{"v1alpha10", "v1alpha2", true},
{"v1beta10", "v1beta2", true},
{"foo", "v1beta2", false},
{"bar", "foo", true},
{"version1", "version2", true}, // Non kube-like versions are sorted alphabetically
{"version1", "version10", true}, // Non kube-like versions are sorted alphabetically
}
for _, tc := range tests {
if e, a := tc.expectedGreater, CompareKubeAwareVersionStrings(tc.v1, tc.v2) > 0; e != a {
if e {
t.Errorf("expected %s to be greater than %s", tc.v1, tc.v2)
} else {
t.Errorf("expected %s to be less than than %s", tc.v1, tc.v2)
}
}
}
}