Skip to content

Commit ef2b034

Browse files
committed
update Cols to ExpectedColNames in go test assersions
1 parent 8516ecd commit ef2b034

File tree

5 files changed

+140
-140
lines changed

5 files changed

+140
-140
lines changed

testing/go/dolt_tables_test.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,24 +26,24 @@ func TestUserSpaceDoltTables(t *testing.T) {
2626
Name: "dolt branches",
2727
Assertions: []ScriptTestAssertion{
2828
{
29-
Query: `SELECT name FROM dolt.branches`,
30-
Cols: []string{"name"},
31-
Expected: []sql.Row{{"main"}},
29+
Query: `SELECT name FROM dolt.branches`,
30+
ExpectedColNames: []string{"name"},
31+
Expected: []sql.Row{{"main"}},
3232
},
3333
{
34-
Query: `SELECT name FROM dolt_branches`,
35-
Cols: []string{"name"},
36-
Expected: []sql.Row{{"main"}},
34+
Query: `SELECT name FROM dolt_branches`,
35+
ExpectedColNames: []string{"name"},
36+
Expected: []sql.Row{{"main"}},
3737
},
3838
{
39-
Query: `SELECT branches.name FROM dolt.branches`,
40-
Cols: []string{"name"},
41-
Expected: []sql.Row{{"main"}},
39+
Query: `SELECT branches.name FROM dolt.branches`,
40+
ExpectedColNames: []string{"name"},
41+
Expected: []sql.Row{{"main"}},
4242
},
4343
{
44-
Query: `SELECT dolt.branches.name FROM dolt.branches`,
45-
Cols: []string{"name"},
46-
Expected: []sql.Row{{"main"}},
44+
Query: `SELECT dolt.branches.name FROM dolt.branches`,
45+
ExpectedColNames: []string{"name"},
46+
Expected: []sql.Row{{"main"}},
4747
},
4848
{
4949
Query: `SELECT dolt_branches.name FROM dolt_branches`,
@@ -2069,7 +2069,7 @@ func TestUserSpaceDoltTables(t *testing.T) {
20692069
},
20702070
},
20712071
{
2072-
Name: "dolt procedures",
2072+
Name: "dolt procedures",
20732073
SetUpScript: []string{
20742074
// TODO: Create procedure when supported
20752075
},

testing/go/framework.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ type ScriptTestAssertion struct {
112112
// This is checked only if no Expected is defined
113113
ExpectedTag string
114114

115-
// Cols is used to check the column names returned from the server.
116-
Cols []string
115+
// ExpectedColNames is used to check the column names returned from the server.
116+
ExpectedColNames []string
117117

118118
// CopyFromSTDIN is used to test the COPY FROM STDIN command.
119119
CopyFromStdInFile string
@@ -224,10 +224,10 @@ func runScript(t *testing.T, ctx context.Context, script ScriptTest, conn *Conne
224224
readRows, err := ReadRows(rows, normalizeRows)
225225
require.NoError(t, err)
226226

227-
if assertion.Cols != nil {
227+
if assertion.ExpectedColNames != nil {
228228
fields := rows.FieldDescriptions()
229-
if assert.Len(t, fields, len(assertion.Cols), "expected length of columns") {
230-
for i, col := range assertion.Cols {
229+
if assert.Len(t, fields, len(assertion.ExpectedColNames), "expected length of columns") {
230+
for i, col := range assertion.ExpectedColNames {
231231
assert.Equal(t, col, fields[i].Name)
232232
}
233233
}

0 commit comments

Comments
 (0)