diff options
author | Micah Stetson <micah@stetsonnet.org> | 2012-12-29 14:20:27 -0800 |
---|---|---|
committer | Micah Stetson <micah@stetsonnet.org> | 2012-12-29 14:20:27 -0800 |
commit | 58c4612c1ec20f372aee92f466ab762e63356425 (patch) | |
tree | f82c9a366b1c29ceff297e4cc417dcb900170f2e /sqlite3_test.go | |
parent | check destination type whether it's *time.Time or not. (diff) | |
download | golite-58c4612c1ec20f372aee92f466ab762e63356425.tar.gz golite-58c4612c1ec20f372aee92f466ab762e63356425.tar.xz |
Fix #33 and #34
Diffstat (limited to 'sqlite3_test.go')
-rw-r--r-- | sqlite3_test.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sqlite3_test.go b/sqlite3_test.go index 68d9680..3529fe7 100644 --- a/sqlite3_test.go +++ b/sqlite3_test.go @@ -3,7 +3,6 @@ package sqlite import ( "database/sql" "os" - "strings" "testing" "time" ) @@ -297,16 +296,17 @@ func TestTimestamp(t *testing.T) { t.Errorf("Value for id 2 should be %v, not %v", timestamp2, ts) } } - } - if seen != 2 { - t.Error("Expected to see two valid timestamps") + if id == 3 { + seen += 1 + if !ts.IsZero() { + t.Errorf("Value for id 3 should be the zero time, not %v", ts) + } + } } - // make sure "nonsense" triggered an error - err = rows.Err() - if err == nil || !strings.Contains(err.Error(), "cannot parse \"nonsense\"") { - t.Error("Expected error from \"nonsense\" timestamp") + if seen != 3 { + t.Error("Expected to see three timestamps") } } |