Skip to content

Commit

Permalink
Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
nathan-artie committed May 13, 2024
1 parent 385c7d1 commit 31a6859
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions clients/redshift/dialect/dialect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,24 +213,14 @@ func TestBuildProcessToastStructColExpression(t *testing.T) {
}

func TestBuildColumnsUpdateFragment(t *testing.T) {
type testCase struct {
name string
columns []columns.Column
expectedString string
}

fooBarCols := []string{"foo", "bar"}

var (
happyPathCols []columns.Column
lastCaseColTypes []columns.Column
)
for _, col := range fooBarCols {
var happyPathCols []columns.Column
for _, col := range []string{"foo", "bar"} {
column := columns.NewColumn(col, typing.String)
column.ToastColumn = false
happyPathCols = append(happyPathCols, column)
}

var lastCaseColTypes []columns.Column
lastCaseCols := []string{"a1", "b2", "c3"}
for _, lastCaseCol := range lastCaseCols {
kd := typing.String
Expand All @@ -248,7 +238,11 @@ func TestBuildColumnsUpdateFragment(t *testing.T) {
lastCaseColTypes = append(lastCaseColTypes, column)
}

testCases := []testCase{
testCases := []struct {
name string
columns []columns.Column
expectedString string
}{
{
name: "happy path",
columns: happyPathCols,
Expand Down

0 comments on commit 31a6859

Please sign in to comment.