github.com/octohelm/storage@v0.0.0-20240516030302-1ac2cc1ea347/pkg/sqlbuilder/functions_test.go (about)

     1  package sqlbuilder_test
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/octohelm/storage/internal/testutil"
     7  
     8  	. "github.com/octohelm/storage/pkg/sqlbuilder"
     9  )
    10  
    11  func TestFunc(t *testing.T) {
    12  	t.Run("invalid", func(t *testing.T) {
    13  		testutil.ShouldBeExpr(t, Func(""), "")
    14  	})
    15  	t.Run("count", func(t *testing.T) {
    16  		testutil.ShouldBeExpr(t, Count(), "COUNT(1)")
    17  	})
    18  	t.Run("AVG", func(t *testing.T) {
    19  		testutil.ShouldBeExpr(t, Avg(), "AVG(*)")
    20  	})
    21  }