Skip to content

Commit

Permalink
fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
XIELongDragon committed Oct 6, 2024
1 parent dd63ff2 commit 09d0024
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
26 changes: 13 additions & 13 deletions exp/insert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func (iets *insertExpressionTestSuite) TestNewInsertExpression_Vals() {
vals := [][]interface{}{
{"a", "b"},
}
ie = ie.SetCols(exp.NewColumnListExpression(nil, "a", "b")).SetVals(vals)
ie = ie.SetCols(exp.NewColumnListExpression(nil, "db", "a", "b")).SetVals(vals)
iets.False(ie.IsEmpty())
iets.False(ie.IsInsertFrom())
iets.Equal(vals, ie.Vals())
Expand All @@ -92,7 +92,7 @@ func (iets *insertExpressionTestSuite) TestNewInsertExpression_Cols() {
vals := [][]interface{}{
{"a", "b"},
}
ce := exp.NewColumnListExpression(nil, "a", "b")
ce := exp.NewColumnListExpression(nil, "db", "a", "b")
ie = ie.SetCols(ce).SetVals(vals)
iets.False(ie.IsEmpty())
iets.False(ie.IsInsertFrom())
Expand Down Expand Up @@ -121,7 +121,7 @@ func (iets *insertExpressionTestSuite) TestNewInsertExpression_appendableExpress
func (iets *insertExpressionTestSuite) TestNewInsertExpression_withRecords() {
ie, err := exp.NewInsertExpression("db", exp.Record{"c": "a"}, exp.Record{"c": "b"})
iets.NoError(err)
iets.Equal(exp.NewColumnListExpression(nil, "c"), ie.Cols())
iets.Equal(exp.NewColumnListExpression(nil, "db", "c"), ie.Cols())
iets.Equal([][]interface{}{{"a"}, {"b"}}, ie.Vals())
iets.False(ie.IsEmpty())
iets.False(ie.IsInsertFrom())
Expand All @@ -130,7 +130,7 @@ func (iets *insertExpressionTestSuite) TestNewInsertExpression_withRecords() {
func (iets *insertExpressionTestSuite) TestNewInsertExpression_withRecordsSlice() {
ie, err := exp.NewInsertExpression("db", []exp.Record{{"c": "a"}, {"c": "b"}})
iets.NoError(err)
iets.Equal(exp.NewColumnListExpression(nil, "c"), ie.Cols())
iets.Equal(exp.NewColumnListExpression(nil, "db", "c"), ie.Cols())
iets.Equal([][]interface{}{{"a"}, {"b"}}, ie.Vals())
iets.False(ie.IsEmpty())
iets.False(ie.IsInsertFrom())
Expand All @@ -153,7 +153,7 @@ func (iets *insertExpressionTestSuite) TestNewInsertExpression_withMap() {
map[string]interface{}{"c": "b"},
)
iets.NoError(err)
iets.Equal(exp.NewColumnListExpression(nil, "c"), ie.Cols())
iets.Equal(exp.NewColumnListExpression(nil, "db", "c"), ie.Cols())
iets.Equal([][]interface{}{{"a"}, {"b"}}, ie.Vals())
iets.False(ie.IsEmpty())
iets.False(ie.IsInsertFrom())
Expand All @@ -169,7 +169,7 @@ func (iets *insertExpressionTestSuite) TestNewInsertExpression_withStructs() {
testRecord{C: "b"},
)
iets.NoError(err)
iets.Equal(exp.NewColumnListExpression(nil, "c"), ie.Cols())
iets.Equal(exp.NewColumnListExpression(nil, "db", "c"), ie.Cols())
iets.Equal([][]interface{}{{"a"}, {"b"}}, ie.Vals())
iets.False(ie.IsEmpty())
iets.False(ie.IsInsertFrom())
Expand All @@ -184,7 +184,7 @@ func (iets *insertExpressionTestSuite) TestNewInsertExpression_withStructSlice()
{C: "b"},
})
iets.NoError(err)
iets.Equal(exp.NewColumnListExpression(nil, "c"), ie.Cols())
iets.Equal(exp.NewColumnListExpression(nil, "db", "c"), ie.Cols())
iets.Equal([][]interface{}{{"a"}, {"b"}}, ie.Vals())
iets.False(ie.IsEmpty())
iets.False(ie.IsInsertFrom())
Expand All @@ -202,7 +202,7 @@ func (iets *insertExpressionTestSuite) TestNewInsertExpression_withStructsWithou
testRecord{FieldA: 2, FieldB: false, FieldC: "b"},
)
iets.NoError(err)
iets.Equal(exp.NewColumnListExpression(nil, "fielda", "fieldb", "fieldc"), ie.Cols())
iets.Equal(exp.NewColumnListExpression(nil, "db", "fielda", "fieldb", "fieldc"), ie.Cols())
iets.Equal([][]interface{}{{int64(1), true, "a"}, {int64(2), false, "b"}}, ie.Vals())
iets.False(ie.IsEmpty())
iets.False(ie.IsInsertFrom())
Expand All @@ -220,7 +220,7 @@ func (iets *insertExpressionTestSuite) TestNewInsertExpression_withStructsIgnore
testRecord{FieldA: 2, FieldB: false, FieldC: "b"},
)
iets.NoError(err)
iets.Equal(exp.NewColumnListExpression(nil, "fieldb", "fieldc"), ie.Cols())
iets.Equal(exp.NewColumnListExpression(nil, "db", "fieldb", "fieldc"), ie.Cols())
iets.Equal([][]interface{}{{true, "a"}, {false, "b"}}, ie.Vals())
iets.False(ie.IsEmpty())
iets.False(ie.IsInsertFrom())
Expand Down Expand Up @@ -254,7 +254,7 @@ func (iets *insertExpressionTestSuite) TestNewInsertExpression_withStructPointer
&testRecord{C: "b"},
)
iets.NoError(err)
iets.Equal(exp.NewColumnListExpression(nil, "c"), ie.Cols())
iets.Equal(exp.NewColumnListExpression(nil, "db", "c"), ie.Cols())
iets.Equal([][]interface{}{{"a"}, {"b"}}, ie.Vals())
iets.False(ie.IsEmpty())
iets.False(ie.IsInsertFrom())
Expand All @@ -278,7 +278,7 @@ func (iets *insertExpressionTestSuite) TestNewInsertExpression_withStructsWithEm
item{Address: "411 Test Addr", Name: "Test4", Phone: Phone{Home: "123123", Primary: "456456"}},
)
iets.NoError(err)
iets.Equal(exp.NewColumnListExpression(nil, "address", "home_phone", "name", "primary_phone"), ie.Cols())
iets.Equal(exp.NewColumnListExpression(nil, "db", "address", "home_phone", "name", "primary_phone"), ie.Cols())
iets.Equal([][]interface{}{
{"111 Test Addr", "123123", "Test1", "456456"},
{"211 Test Addr", "123123", "Test2", "456456"},
Expand Down Expand Up @@ -307,7 +307,7 @@ func (iets *insertExpressionTestSuite) TestNewInsertExpression_withStructsWithEm
item{Address: "411 Test Addr", Name: "Test4", Phone: &Phone{Home: "123123", Primary: "456456"}},
)
iets.NoError(err)
iets.Equal(exp.NewColumnListExpression(nil, "address", "home_phone", "name", "primary_phone"), ie.Cols())
iets.Equal(exp.NewColumnListExpression(nil, "db", "address", "home_phone", "name", "primary_phone"), ie.Cols())
iets.Equal([][]interface{}{
{"111 Test Addr", "123123", "Test1", "456456"},
{"211 Test Addr", "123123", "Test2", "456456"},
Expand Down Expand Up @@ -336,7 +336,7 @@ func (iets *insertExpressionTestSuite) TestNewInsertExpression_withNilEmbeddedSt
item{Address: "411 Test Addr", Name: "Test4"},
)
iets.NoError(err)
iets.Equal(exp.NewColumnListExpression(nil, "address", "name"), ie.Cols())
iets.Equal(exp.NewColumnListExpression(nil, "db", "address", "name"), ie.Cols())
iets.Equal([][]interface{}{
{"111 Test Addr", "Test1"},
{"211 Test Addr", "Test2"},
Expand Down
8 changes: 4 additions & 4 deletions exp/truncate_clauses_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func TestTruncateClausesSuite(t *testing.T) {

func (tcs *truncateClausesSuite) TestHasTable() {
c := exp.NewTruncateClauses()
cle := exp.NewColumnListExpression(nil, "test1", "test2")
cle := exp.NewColumnListExpression(nil, "db", "test1", "test2")
c2 := c.SetTable(cle)

tcs.False(c.HasTable())
Expand All @@ -27,7 +27,7 @@ func (tcs *truncateClausesSuite) TestHasTable() {

func (tcs *truncateClausesSuite) TestTable() {
c := exp.NewTruncateClauses()
cle := exp.NewColumnListExpression(nil, "test1", "test2")
cle := exp.NewColumnListExpression(nil, "db", "test1", "test2")
c2 := c.SetTable(cle)

tcs.Nil(c.Table())
Expand All @@ -36,9 +36,9 @@ func (tcs *truncateClausesSuite) TestTable() {
}

func (tcs *truncateClausesSuite) TestSetTable() {
cle := exp.NewColumnListExpression(nil, "test1", "test2")
cle := exp.NewColumnListExpression(nil, "db", "test1", "test2")
c := exp.NewTruncateClauses().SetTable(cle)
cle2 := exp.NewColumnListExpression(nil, "test3", "test4")
cle2 := exp.NewColumnListExpression(nil, "db", "test3", "test4")
c2 := c.SetTable(cle2)

tcs.Equal(cle, c.Table())
Expand Down
6 changes: 3 additions & 3 deletions exp/update_clauses_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func (ucs *updateClausesSuite) TestSetSetValues() {

func (ucs *updateClausesSuite) TestFrom() {
c := exp.NewUpdateClauses()
ce := exp.NewColumnListExpression(nil, "a", "b")
ce := exp.NewColumnListExpression(nil, "db", "a", "b")
c2 := c.SetFrom(ce)

ucs.Nil(c.From())
Expand All @@ -76,9 +76,9 @@ func (ucs *updateClausesSuite) TestFrom() {
}

func (ucs *updateClausesSuite) TestSetFrom() {
ce1 := exp.NewColumnListExpression(nil, "a", "b")
ce1 := exp.NewColumnListExpression(nil, "db", "a", "b")
c := exp.NewUpdateClauses().SetFrom(ce1)
ce2 := exp.NewColumnListExpression(nil, "a", "b")
ce2 := exp.NewColumnListExpression(nil, "db", "a", "b")
c2 := c.SetFrom(ce2)

ucs.Equal(ce1, c.From())
Expand Down

0 comments on commit 09d0024

Please sign in to comment.