Skip to content

Commit

Permalink
Add test for time field
Browse files Browse the repository at this point in the history
  • Loading branch information
georgysavva committed Oct 16, 2020
1 parent b199b14 commit 6f18834
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions dbscan/rowscanner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package dbscan_test

import (
"testing"
"time"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -257,6 +258,17 @@ func TestRowScanner_Scan_structDestination(t *testing.T) {
Foo: "foo val",
},
},
{
name: "time field is filled from a timestamp column",
query: `
SELECT '2020-10-16 09:36:59+00:00'::timestamp AS foo
`,
expected: struct {
Foo time.Time
}{
Foo: time.Date(2020, 10, 16, 9, 36, 59, 0, time.UTC),
},
},
{
name: "map field is filled from a json column",
query: `
Expand Down

0 comments on commit 6f18834

Please sign in to comment.