Skip to content

Commit 8bdfca3

Browse files
add test case
1 parent 03afa02 commit 8bdfca3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

x-pack/osquerybeat/ext/osquery-extension/pkg/encoding/encoding_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,14 @@ func Test_formatTimeWithTagFormat(t *testing.T) {
404404
want: "0001-01-01T00:00:00Z",
405405
wantErr: false,
406406
},
407+
{
408+
name: "Zero unix timestamp with UseNumbersZeroValues flag",
409+
fieldValue: reflect.ValueOf(time.Time{}),
410+
flag: EncodingFlagUseNumbersZeroValues,
411+
tag: tagPtr(`format:"unix"`),
412+
want: "0",
413+
wantErr: false,
414+
},
407415
{
408416
name: "With timezone Asia/Tokyo",
409417
fieldValue: reflect.ValueOf(time.Date(2023, 6, 15, 14, 30, 0, 0, time.UTC)),

0 commit comments

Comments
 (0)