aboutsummaryrefslogtreecommitdiff
path: root/sqlite3_test.go
diff options
context:
space:
mode:
authorMicah Stetson <micah@stetsonnet.org>2012-12-29 16:36:29 -0800
committerMicah Stetson <micah@stetsonnet.org>2012-12-29 16:36:29 -0800
commitce139f706b870082071a9d9fd18284c7b7fc9d65 (patch)
treeb3513037f4b656b274bfd0007ccc5dadcd0a807e /sqlite3_test.go
parentRefactor timestamp tests (diff)
downloadgolite-ce139f706b870082071a9d9fd18284c7b7fc9d65.tar.gz
golite-ce139f706b870082071a9d9fd18284c7b7fc9d65.tar.xz
Support time values with nanosecond precision
Diffstat (limited to 'sqlite3_test.go')
-rw-r--r--sqlite3_test.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/sqlite3_test.go b/sqlite3_test.go
index 6a508bc..a5f324f 100644
--- a/sqlite3_test.go
+++ b/sqlite3_test.go
@@ -251,7 +251,7 @@ func TestTimestamp(t *testing.T) {
}
timestamp1 := time.Date(2012, time.April, 6, 22, 50, 0, 0, time.UTC)
- timestamp2 := time.Date(2006, time.January, 2, 15, 4, 5, 3000000, time.UTC)
+ timestamp2 := time.Date(2006, time.January, 2, 15, 4, 5, 123456789, time.UTC)
tests := []struct {
value interface{}
expected time.Time
@@ -263,7 +263,7 @@ func TestTimestamp(t *testing.T) {
{timestamp1.In(time.FixedZone("TEST", -7*3600)), timestamp1},
{"2012-11-04", time.Date(2012, time.November, 4, 0, 0, 0, 0, time.UTC)},
{timestamp2, timestamp2},
- {"2006-01-02 15:04:05.003", timestamp2},
+ {"2006-01-02 15:04:05.123456789", timestamp2},
}
for i := range tests {
_, err = db.Exec("INSERT INTO foo(id, ts, dt) VALUES(?, ?, ?)", i, tests[i].value, tests[i].value)