Add pause until, store as unix second, to disable a user for a time
This commit is contained in:
22
config/time_test.go
Normal file
22
config/time_test.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestTimeMarshal(t *testing.T) {
|
||||
now := time.Now()
|
||||
nowt := Time(now)
|
||||
var other Time
|
||||
if b, err := json.Marshal(nowt); err != nil {
|
||||
t.Fatal(err)
|
||||
} else if len(b) < 5 {
|
||||
t.Fatal(string(b))
|
||||
} else if err := json.Unmarshal(b, &other); err != nil {
|
||||
t.Fatal(err)
|
||||
} else if now.Unix() != other.Unix() {
|
||||
t.Fatal(other.Unix(), now.Unix())
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user