Skip to content

Commit

Permalink
Adding tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tang8330 committed Aug 27, 2024
1 parent 2bd2a01 commit 251b509
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions clients/bigquery/converters/converters_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ package converters

import (
"testing"
"time"

"github.com/artie-labs/transfer/lib/typing/ext"

"github.com/artie-labs/transfer/lib/numbers"
"github.com/artie-labs/transfer/lib/typing/decimal"
Expand Down Expand Up @@ -34,6 +37,12 @@ func TestStringConverter_Convert(t *testing.T) {
_, err := converter.Convert(123)
assert.ErrorContains(t, err, "expected string/*decimal.Decimal/bool received int with value 123")
}
{
// Extended time
val, err := converter.Convert(ext.NewExtendedTime(time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), ext.DateTimeKindType, ""))
assert.NoError(t, err)
assert.Equal(t, "2021-01-01T00:00:00Z", val)
}
}

func TestIntegerConverter_Convert(t *testing.T) {
Expand Down

0 comments on commit 251b509

Please sign in to comment.