Skip to content

Commit

Permalink
test: add SkipNoFeature helper
Browse files Browse the repository at this point in the history
  • Loading branch information
ernado committed Aug 21, 2022
1 parent 92e5379 commit f379769
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 6 additions & 0 deletions client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ func Conn(t testing.TB) *Client {
return ConnOpt(t, Options{})
}

func SkipNoFeature(t *testing.T, client *Client, feature proto.Feature) {
if !client.ServerInfo().Has(feature) {
t.Skipf("Skipping (feature %q not supported)", feature)
}
}

func TestDial(t *testing.T) {
t.Run("Ok", func(t *testing.T) {
conn := Conn(t)
Expand Down
4 changes: 1 addition & 3 deletions query_params_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ import (

func TestQueryParameters(t *testing.T) {
conn := Conn(t)
if !conn.ServerInfo().Has(proto.FeatureParameters) {
t.Skip("Skipping (not supported)")
}
SkipNoFeature(t, conn, proto.FeatureParameters)
ctx := context.Background()
require.NoError(t, conn.Do(ctx, Query{
Body: "select {num:UInt8} v, {str:String} s",
Expand Down

0 comments on commit f379769

Please sign in to comment.