stabalize tests for time

pull/1448/head
Cory LaNou 2015-01-29 12:32:31 -07:00
parent 42630c38dc
commit acbaf9aae4
1 changed files with 4 additions and 1 deletions

View File

@ -103,23 +103,26 @@ func TestBatchWrite_UnmarshalRFC(t *testing.T) {
tests := []struct {
name string
rfc string
now time.Time
expected time.Time
}{
{
name: "RFC3339Nano",
rfc: time.RFC3339Nano,
now: now,
expected: now,
},
{
name: "RFC3339",
rfc: time.RFC3339,
now: now.Round(time.Second),
expected: now.Round(time.Second),
},
}
for _, test := range tests {
t.Logf("testing %q\n", test.name)
ts := now.Format(test.rfc)
ts := test.now.Format(test.rfc)
data := []byte(fmt.Sprintf(`{"timestamp": %q}`, ts))
t.Logf("json: %s", string(data))
var br httpd.BatchWrite