(t *testing.T)
| 524 | } |
| 525 | |
| 526 | func TestIsDropTableOnViewError(t *testing.T) { |
| 527 | tests := []struct { |
| 528 | name string |
| 529 | err error |
| 530 | want bool |
| 531 | }{ |
| 532 | { |
| 533 | name: "drop table on view error", |
| 534 | err: errors.New("Catalog Error: Existing object users is of type View, trying to drop type Table"), |
| 535 | want: true, |
| 536 | }, |
| 537 | { |
| 538 | name: "unrelated error", |
| 539 | err: errors.New("Catalog Error: Table with name users does not exist!"), |
| 540 | want: false, |
| 541 | }, |
| 542 | { |
| 543 | name: "nil error", |
| 544 | err: nil, |
| 545 | want: false, |
| 546 | }, |
| 547 | } |
| 548 | |
| 549 | for _, tt := range tests { |
| 550 | t.Run(tt.name, func(t *testing.T) { |
| 551 | if got := isDropTableOnViewError(tt.err); got != tt.want { |
| 552 | t.Fatalf("isDropTableOnViewError(%v) = %v, want %v", tt.err, got, tt.want) |
| 553 | } |
| 554 | }) |
| 555 | } |
| 556 | } |
| 557 | |
| 558 | // TestIsCallerCancellation pins down the discriminator that makes the |
| 559 | // difference between "user pressed Ctrl-C" and "the worker died and gRPC |
nothing calls this directly
no test coverage detected