Skip to content

Commit

Permalink
test: add IPv4 case
Browse files Browse the repository at this point in the history
  • Loading branch information
ernado committed Jan 29, 2022
1 parent a9ce55b commit 57c13bf
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,18 @@ func TestClient_Query(t *testing.T) {
require.Equal(t, 1, data.Rows())
require.Equal(t, v, data[0])
})
t.Run("IPv4", func(t *testing.T) {
t.Parallel()
var data proto.ColIPv4
require.NoError(t, Conn(t).Do(ctx, Query{
Body: `SELECT '10.10.0.1'::IPv4 as v`,
Result: proto.Results{
{Name: "v", Data: &data},
},
}))
require.Equal(t, 1, data.Rows())
require.Equal(t, netaddr.MustParseIP("10.10.0.1"), data[0].ToIP())
})
t.Run("InsertDateTime", func(t *testing.T) {
t.Parallel()
conn := Conn(t)
Expand Down

0 comments on commit 57c13bf

Please sign in to comment.