Skip to content

Commit 4fa1023

Browse files
author
Jeff Wolski
committed
Test non-zero nanosecond
1 parent 02b5c51 commit 4fa1023

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

fluent/fluent_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ func Test_SubSecondPrecision(t *testing.T) {
198198
fluent.conn = &Conn{}
199199

200200
// Exercise the test subject
201-
timestamp := time.Unix(1267867237, 0)
201+
timestamp := time.Unix(1267867237, 256)
202202
encodedData, err := fluent.EncodeData("tag", timestamp, map[string]string{
203203
"foo": "bar",
204204
})
@@ -209,7 +209,7 @@ func Test_SubSecondPrecision(t *testing.T) {
209209
t.Error(err)
210210
}
211211

212-
expected := "\x94\xA3tag\xC7\x08\x00K\x92\u001Ee\x00\x00\x00\x00\x81\xA3foo\xA3bar\xC0"
212+
expected := "\x94\xA3tag\xC7\x08\x00K\x92\u001Ee\x00\x00\x01\x00\x81\xA3foo\xA3bar\xC0"
213213
actual := string(encodedData)
214214
assert.Equal(t, expected, actual)
215215
}

fluent/proto.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ func (t *EventTime) MarshalBinaryTo(b []byte) error {
8989
return nil
9090
}
9191

92+
// UnmarshalBinary is not implemented since decoding messages is not supported
93+
// by this library.
9294
func (t *EventTime) UnmarshalBinary(b []byte) error {
93-
// TODO: Implement
9495
return nil
9596
}

0 commit comments

Comments
 (0)