qb: TTL and Timestamp named parameters

This commit is contained in:
Michał Matczuk
2017-08-01 12:44:10 +02:00
parent ab0839a9d1
commit 906f9433fe
9 changed files with 72 additions and 53 deletions

18
qb/utils_test.go Normal file
View File

@@ -0,0 +1,18 @@
package qb
import (
"testing"
"time"
)
func TestTTL(t *testing.T) {
if TTL(time.Second*86400) != 86400 {
t.Fatal("wrong ttl")
}
}
func TestTimestamp(t *testing.T) {
if Timestamp(time.Unix(0, 0).Add(time.Microsecond*123456789)) != 123456789 {
t.Fatal("wrong timestamp")
}
}