Skip to content

Commit

Permalink
fix: fixed unit test for TestFuncMap_unixToTime
Browse files Browse the repository at this point in the history
  • Loading branch information
wwoytenko committed May 6, 2024
1 parent 055f13e commit b54a298
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/toolkit/template_functions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -992,6 +992,7 @@ func TestFuncMap_unixToTime(t *testing.T) {
//expected :=
fmt := "2006-01-02 15:04:05.999999999 -0700 MST"
expected, err := time.Parse(fmt, "2024-01-27 18:30:33 +0200 EET")
expected = expected.In(time.UTC)
require.NoError(t, err)
buf := bytes.NewBuffer(nil)
tmplStr := `
Expand All @@ -1004,6 +1005,7 @@ func TestFuncMap_unixToTime(t *testing.T) {
err = tmpl.Execute(buf, obj)
require.NoError(t, err)
res, err := time.Parse(fmt, buf.String())
res = res.In(time.UTC)
require.NoError(t, err)
require.Equal(t, expected, res)
}

0 comments on commit b54a298

Please sign in to comment.