...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 package config
16
17 import "testing"
18
19 func TestV2DeprecationEnum_IsAtLeast(t *testing.T) {
20 tests := []struct {
21 e V2DeprecationEnum
22 v2d V2DeprecationEnum
23 want bool
24 }{
25 {V2_DEPR_0_NOT_YET, V2_DEPR_0_NOT_YET, true},
26 {V2_DEPR_0_NOT_YET, V2_DEPR_1_WRITE_ONLY_DROP, false},
27 {V2_DEPR_0_NOT_YET, V2_DEPR_2_GONE, false},
28 {V2_DEPR_2_GONE, V2_DEPR_1_WRITE_ONLY_DROP, true},
29 {V2_DEPR_2_GONE, V2_DEPR_0_NOT_YET, true},
30 {V2_DEPR_2_GONE, V2_DEPR_2_GONE, true},
31 {V2_DEPR_1_WRITE_ONLY, V2_DEPR_1_WRITE_ONLY_DROP, false},
32 {V2_DEPR_1_WRITE_ONLY_DROP, V2_DEPR_1_WRITE_ONLY, true},
33 }
34 for _, tt := range tests {
35 t.Run(string(tt.e)+" >= "+string(tt.v2d), func(t *testing.T) {
36 if got := tt.e.IsAtLeast(tt.v2d); got != tt.want {
37 t.Errorf("IsAtLeast() = %v, want %v", got, tt.want)
38 }
39 })
40 }
41 }
42
View as plain text