Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SpencerTorres committed Jan 7, 2025
1 parent dfc593b commit bbf06d8
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions tests/issues/1446_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"testing"

"github.com/ClickHouse/clickhouse-go/v2/tests"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

Expand Down Expand Up @@ -50,19 +51,12 @@ func TestIssue1446(t *testing.T) {

failRow := sampleFailRow{}
err = conn.QueryRow(ctx, "SELECT * FROM issue_1446 LIMIT 1").ScanStruct(&failRow)
if err == nil {
t.Errorf("expected column convert error for tuple *string to string")
}
assert.EqualError(t, err, "clickhouse [ScanRow]: (my_tuple) converting *string to string is unsupported")

okRow := sampleOkRow{}
err = conn.QueryRow(ctx, "SELECT * FROM issue_1446 LIMIT 1").ScanStruct(&okRow)
require.NoError(t, err)

if *okRow.MyTuple.TupleOne != "one" {
t.Errorf("expected 'one' but got '%s'", *okRow.MyTuple.TupleOne)
}

if *okRow.MyTuple.TupleTwo != "two" {
t.Errorf("expected 'two' but got '%s'", *okRow.MyTuple.TupleTwo)
}
assert.Equal(t, "one", *okRow.MyTuple.TupleOne)
assert.Equal(t, "two", *okRow.MyTuple.TupleTwo)
}

0 comments on commit bbf06d8

Please sign in to comment.