...
1
16
17 package framework
18
19 import (
20 "fmt"
21 "testing"
22
23 "k8s.io/kubernetes/test/e2e/framework/internal/unittests/features"
24 )
25
26 func TestTagsEqual(t *testing.T) {
27 testcases := []struct {
28 a, b interface{}
29 expectEqual bool
30 }{
31 {1, 2, false},
32 {2, 2, false},
33 {WithSlow(), 2, false},
34 {WithSlow(), WithSerial(), false},
35 {WithSerial(), WithSlow(), false},
36 {WithSlow(), WithSlow(), true},
37 {WithSerial(), WithSerial(), true},
38 {WithLabel("hello"), WithLabel("world"), false},
39 {WithLabel("hello"), WithLabel("hello"), true},
40 {WithFeatureGate(features.Test), WithLabel("Test"), false},
41 {WithFeatureGate(features.Test), WithFeatureGate(features.Test), true},
42 }
43
44 for _, tc := range testcases {
45 t.Run(fmt.Sprintf("%v=%v", tc.a, tc.b), func(t *testing.T) {
46 actualEqual := TagsEqual(tc.a, tc.b)
47 if actualEqual != tc.expectEqual {
48 t.Errorf("expected %v, got %v", tc.expectEqual, actualEqual)
49 }
50 })
51 }
52 }
53
View as plain text