github.com/ydb-platform/ydb-go-sdk/v3@v3.89.2/internal/bind/bind_test.go (about)

     1  package bind
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/stretchr/testify/require"
     7  )
     8  
     9  func TestSort(t *testing.T) {
    10  	for _, tt := range []struct {
    11  		bindings []Bind
    12  		sorted   []Bind
    13  	}{
    14  		{
    15  			bindings: []Bind{
    16  				NumericArgs{},
    17  				AutoDeclare{},
    18  				TablePathPrefix(""),
    19  			},
    20  			sorted: []Bind{
    21  				TablePathPrefix(""),
    22  				AutoDeclare{},
    23  				NumericArgs{},
    24  			},
    25  		},
    26  	} {
    27  		t.Run("", func(t *testing.T) {
    28  			require.Equal(t, tt.sorted, Sort(tt.bindings))
    29  		})
    30  	}
    31  }