(t *testing.T)
| 22 | } |
| 23 | |
| 24 | func TestIsUnifiedInstanceLimit(t *testing.T) { |
| 25 | tests := []struct { |
| 26 | name string |
| 27 | instanceLimit int |
| 28 | activatedLimit int |
| 29 | want bool |
| 30 | }{ |
| 31 | {name: "equal finite caps", instanceLimit: 10, activatedLimit: 10, want: true}, |
| 32 | {name: "activated cap larger than registration cap", instanceLimit: 10, activatedLimit: 20, want: true}, |
| 33 | {name: "split cap", instanceLimit: 50, activatedLimit: 20, want: false}, |
| 34 | {name: "unlimited both sides", instanceLimit: math.MaxInt, activatedLimit: math.MaxInt, want: true}, |
| 35 | {name: "unlimited registration finite activation", instanceLimit: math.MaxInt, activatedLimit: 20, want: false}, |
| 36 | {name: "finite registration unlimited activation", instanceLimit: 20, activatedLimit: math.MaxInt, want: true}, |
| 37 | } |
| 38 | for _, tt := range tests { |
| 39 | t.Run(tt.name, func(t *testing.T) { |
| 40 | if got := isUnifiedInstanceLimit(tt.instanceLimit, tt.activatedLimit); got != tt.want { |
| 41 | t.Fatalf("isUnifiedInstanceLimit(%d, %d) = %v, want %v", tt.instanceLimit, tt.activatedLimit, got, tt.want) |
| 42 | } |
| 43 | }) |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | func TestIsFeatureEnabledForInstanceUnifiedLicense(t *testing.T) { |
| 48 | ctx := context.Background() |
nothing calls this directly
no test coverage detected