MCPcopy
hub / github.com/dropbox/godropbox / TestTime

Function TestTime

database/sqltypes/sqltypes_test.go:55–67  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

53}
54
55func TestTime(t *testing.T) {
56 date := time.Date(1999, 1, 2, 3, 4, 5, 0, time.UTC)
57 v, _ := BuildValue(date)
58 if v.String() != "1999-01-02 03:04:05.000000" {
59 t.Errorf("Expecting 1999-01-02 03:04:05.000000, got %s", v.String())
60 }
61
62 b := &bytes.Buffer{}
63 v.EncodeSql(b)
64 if b.String() != "'1999-01-02 03:04:05.000000'" {
65 t.Errorf("Expecting '1999-01-02 03:04:05.000000', got %s", b.String())
66 }
67}
68
69const (
70 INVALIDNEG = "-9223372036854775809"

Callers

nothing calls this directly

Calls 3

BuildValueFunction · 0.85
EncodeSqlMethod · 0.80
StringMethod · 0.65

Tested by

no test coverage detected