Skip to content

Commit bea58e6

Browse files
committed
Fixed MessagePack expectation on serialized timestamp to support ext 8 and fixext 8.
Signed-off-by: alexlry <alexandre@keymantics.com>
1 parent 3c0ef01 commit bea58e6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

fluent/fluent_test.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,13 @@ func Test_SubSecondPrecision(t *testing.T) {
210210
t.Error(err)
211211
}
212212

213-
expected := "\x94\xA3tag\xC7\x08\x00K\x92\u001Ee\x00\x00\x01\x00\x81\xA3foo\xA3bar\xC0"
213+
// 8 bytes timestamp can be represented using ext 8 or fixext 8
214+
expected1 := "\x94\xA3tag\xC7\x08\x00K\x92\u001Ee\x00\x00\x01\x00\x81\xA3foo\xA3bar\xC0"
215+
expected2 := "\x94\xa3tag\xD7\x00K\x92\x1Ee\x00\x00\x01\x00\x81\xA3foo\xA3bar\xc0"
214216
actual := string(encodedData)
215-
assert.Equal(t, expected, actual)
217+
if actual != expected1 && actual != expected2 {
218+
t.Errorf("got %x,\n except %x\n or %x", actual, expected1, expected2)
219+
}
216220
}
217221

218222
func Test_MarshalAsJSON(t *testing.T) {

0 commit comments

Comments
 (0)