(t *testing.T)
| 413 | } |
| 414 | |
| 415 | func TestDedicatedColumns_Validate(t *testing.T) { |
| 416 | testCases := []struct { |
| 417 | name string |
| 418 | cols DedicatedColumns |
| 419 | isValid bool |
| 420 | expectedWarnings []error |
| 421 | }{ |
| 422 | {name: "nil", isValid: true}, |
| 423 | {name: "empty", cols: DedicatedColumns{}, isValid: true}, |
| 424 | { |
| 425 | name: "minimal valid", |
| 426 | cols: DedicatedColumns{ |
| 427 | {Name: "test.span.str", Scope: DedicatedColumnScopeSpan, Type: DedicatedColumnTypeString}, |
| 428 | }, |
| 429 | isValid: true, |
| 430 | }, |
| 431 | { |
| 432 | name: "array option", |
| 433 | cols: DedicatedColumns{ |
| 434 | {Name: "test.span.str", Scope: DedicatedColumnScopeSpan, Type: DedicatedColumnTypeString, Options: DedicatedColumnOptions{DedicatedColumnOptionArray}}, |
| 435 | }, |
| 436 | isValid: true, |
| 437 | }, |
| 438 | { |
| 439 | name: "blob option", |
| 440 | cols: DedicatedColumns{ |
| 441 | {Name: "test.span.str", Scope: DedicatedColumnScopeSpan, Type: DedicatedColumnTypeString, Options: DedicatedColumnOptions{DedicatedColumnOptionBlob}}, |
| 442 | }, |
| 443 | isValid: true, |
| 444 | }, |
| 445 | { |
| 446 | name: "all options", |
| 447 | cols: DedicatedColumns{ |
| 448 | {Name: "test.span.str", Scope: DedicatedColumnScopeSpan, Type: DedicatedColumnTypeString, Options: DedicatedColumnOptions{DedicatedColumnOptionArray, DedicatedColumnOptionBlob}}, |
| 449 | }, |
| 450 | isValid: true, |
| 451 | }, |
| 452 | { |
| 453 | name: "all valid scopes and types", |
| 454 | cols: DedicatedColumns{ |
| 455 | {Name: "test.span.str", Scope: DedicatedColumnScopeSpan, Type: DedicatedColumnTypeString}, |
| 456 | {Name: "test.span.int", Scope: DedicatedColumnScopeSpan, Type: DedicatedColumnTypeInt}, |
| 457 | {Name: "test.res.str", Scope: DedicatedColumnScopeResource, Type: DedicatedColumnTypeString}, |
| 458 | {Name: "test.res.int", Scope: DedicatedColumnScopeResource, Type: DedicatedColumnTypeInt}, |
| 459 | }, |
| 460 | isValid: true, |
| 461 | }, |
| 462 | { |
| 463 | name: "maximum allowed columns", |
| 464 | cols: DedicatedColumns{ |
| 465 | {Name: "test.res.str-01", Scope: DedicatedColumnScopeResource, Type: DedicatedColumnTypeString}, |
| 466 | {Name: "test.res.str-02", Scope: DedicatedColumnScopeResource, Type: DedicatedColumnTypeString}, |
| 467 | {Name: "test.res.str-03", Scope: DedicatedColumnScopeResource, Type: DedicatedColumnTypeString}, |
| 468 | {Name: "test.res.str-04", Scope: DedicatedColumnScopeResource, Type: DedicatedColumnTypeString}, |
| 469 | {Name: "test.res.str-05", Scope: DedicatedColumnScopeResource, Type: DedicatedColumnTypeString}, |
| 470 | {Name: "test.res.str-06", Scope: DedicatedColumnScopeResource, Type: DedicatedColumnTypeString}, |
| 471 | {Name: "test.res.str-07", Scope: DedicatedColumnScopeResource, Type: DedicatedColumnTypeString}, |
| 472 | {Name: "test.res.str-08", Scope: DedicatedColumnScopeResource, Type: DedicatedColumnTypeString}, |
nothing calls this directly
no test coverage detected