(t *testing.T)
| 367 | } |
| 368 | |
| 369 | func TestStatic_StringArray(t *testing.T) { |
| 370 | tests := []struct { |
| 371 | arg any |
| 372 | ok bool |
| 373 | }{ |
| 374 | // supported values |
| 375 | {arg: []string(nil), ok: true}, |
| 376 | {arg: []string{}, ok: true}, |
| 377 | {arg: []string{""}, ok: true}, |
| 378 | {arg: []string{"aa"}, ok: true}, |
| 379 | {arg: []string{"aa", "bb"}, ok: true}, |
| 380 | // unsupported values |
| 381 | {arg: 1}, |
| 382 | {arg: 3.14}, |
| 383 | {arg: "test"}, |
| 384 | {arg: true}, |
| 385 | {arg: StatusOk}, |
| 386 | {arg: KindClient}, |
| 387 | {arg: []int{1, 2}}, |
| 388 | {arg: []float64{1.0, 2.2}}, |
| 389 | {arg: []bool{true, true}}, |
| 390 | } |
| 391 | |
| 392 | for _, tt := range tests { |
| 393 | t.Run(testName(tt.arg), func(t *testing.T) { |
| 394 | static := newStatic(tt.arg) |
| 395 | s, ok := static.StringArray() |
| 396 | |
| 397 | require.Equal(t, tt.ok, ok) |
| 398 | if tt.ok { |
| 399 | assert.Equal(t, tt.arg, s) |
| 400 | } |
| 401 | }) |
| 402 | } |
| 403 | } |
| 404 | |
| 405 | func TestStatic_BooleanArray(t *testing.T) { |
| 406 | tests := []struct { |
nothing calls this directly
no test coverage detected