(t *testing.T)
| 646 | } |
| 647 | |
| 648 | func TestBackendOptionsPluginName(t *testing.T) { |
| 649 | tests := []struct { |
| 650 | name string |
| 651 | options *BackendOptions |
| 652 | expected string |
| 653 | }{ |
| 654 | { |
| 655 | name: "nil doesn't blow up", |
| 656 | options: nil, |
| 657 | expected: "", |
| 658 | }, |
| 659 | { |
| 660 | name: "No interpolation results in empty plugin name", |
| 661 | options: &BackendOptions{ |
| 662 | TableName: "test_table", |
| 663 | Connection: "localhost:7777", |
| 664 | }, |
| 665 | expected: "", |
| 666 | }, |
| 667 | { |
| 668 | name: "Proper variable name results in correct plugin name", |
| 669 | options: &BackendOptions{ |
| 670 | TableName: "test_table", |
| 671 | Connection: "@@plugins.aws.connection", |
| 672 | }, |
| 673 | expected: "aws", |
| 674 | }, |
| 675 | } |
| 676 | |
| 677 | for _, tt := range tests { |
| 678 | t.Run(tt.name, func(t *testing.T) { |
| 679 | actual := tt.options.PluginName() |
| 680 | if actual != tt.expected { |
| 681 | t.Errorf("unexpected plugin name, got: %s, want: %s", actual, tt.expected) |
| 682 | } |
| 683 | }) |
| 684 | } |
| 685 | } |
nothing calls this directly
no test coverage detected