Commit cacfe586 authored by Sebastian Stark's avatar Sebastian Stark

add test for skewClock

parent 6093617a
/* See the file "LICENSE.txt" for the full license governing this code. */
package main
import (
func TestSkewClock(t *testing.T) {
var st int64 = 18
var inc int64 = 5
clock := newSkewClock(st)
t1 := clock.Now().Unix()
clock.forward(time.Second * time.Duration(inc))
t2 := clock.Now().Unix()
if t1 != st {
t.Errorf("wanted %d, but got %v", st, t1)
if t2 != st+inc {
t.Errorf("wanted %d, but got %v", st+inc, t2)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment