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

     1  package builder_test
     2  
     3  import (
     4  	"testing"
     5  
     6  	. "gitee.com/eden-framework/sqlx/builder"
     7  	. "gitee.com/eden-framework/sqlx/builder/buidertestingutils"
     8  	"github.com/onsi/gomega"
     9  )
    10  
    11  func TestFunc(t *testing.T) {
    12  	t.Run("invalid", func(t *testing.T) {
    13  		gomega.NewWithT(t).Expect(Func("")).To(BeExpr(""))
    14  	})
    15  	t.Run("count", func(t *testing.T) {
    16  		gomega.NewWithT(t).Expect(Count()).To(BeExpr("COUNT(1)"))
    17  	})
    18  	t.Run("AVG", func(t *testing.T) {
    19  		gomega.NewWithT(t).Expect(Avg()).To(BeExpr("AVG(*)"))
    20  	})
    21  }