go-waku/waku/v2/utils/time_test.go

19 lines
386 B
Go
Raw Normal View History

2021-10-18 13:48:04 +00:00
package utils
import (
"testing"
"time"
"github.com/stretchr/testify/require"
"google.golang.org/protobuf/proto"
2021-10-18 13:48:04 +00:00
)
func TestGetUnixEpochFrom(t *testing.T) {
loc := time.UTC
timestamp := GetUnixEpochFrom(time.Date(2019, 1, 1, 0, 0, 0, 0, loc))
require.Equal(t, proto.Int64(int64(1546300800*time.Second)), timestamp)
timestamp = GetUnixEpoch()
require.NotNil(t, timestamp)
2021-10-18 13:48:04 +00:00
}