gitee.com/eden-framework/sqlx@v0.0.3/builder/assignment_test.go (about)

     1  package builder_test
     2  
     3  import (
     4  	"context"
     5  	"testing"
     6  
     7  	. "gitee.com/eden-framework/sqlx/builder"
     8  	. "gitee.com/eden-framework/sqlx/builder/buidertestingutils"
     9  	"github.com/onsi/gomega"
    10  )
    11  
    12  func TestAssignment(t *testing.T) {
    13  	t.Run("ColumnsAndValues", func(t *testing.T) {
    14  		gomega.NewWithT(t).Expect(
    15  			ColumnsAndValues(Cols("a", "b"), 1, 2, 3, 4).Ex(ContextWithToggles(context.Background(), Toggles{
    16  				ToggleUseValues: true,
    17  			})),
    18  		).To(BeExpr("(a,b) VALUES (?,?),(?,?)", 1, 2, 3, 4))
    19  	})
    20  }