19 строки
279 Б
Go
19 строки
279 Б
Go
package godog
|
|
|
|
import (
|
|
"testing"
|
|
"time"
|
|
)
|
|
|
|
func init() {
|
|
timeNowFunc = func() time.Time {
|
|
return time.Time{}
|
|
}
|
|
}
|
|
|
|
func TestTimeNowFunc(t *testing.T) {
|
|
now := timeNowFunc()
|
|
if !now.IsZero() {
|
|
t.Fatalf("expected zeroed time, but got: %s", now.Format(time.RFC3339))
|
|
}
|
|
}
|