passforios-gopenpgp/crypto/time_test.go

18 lines
285 B
Go
Raw Normal View History

package crypto
import (
"testing"
"time"
"github.com/stretchr/testify/assert"
)
func TestTime(t *testing.T) {
UpdateTime(1571072494)
time.Sleep(1 * time.Second)
2021-06-16 14:06:07 +02:00
now := GetUnixTime()
2021-06-16 14:06:07 +02:00
assert.Exactly(t, int64(1571072494), now) // Use latest server time
UpdateTime(testTime)
}