godog/utils_test.go
Softonik f6ed69097f
Некоторые проверки провалились
test / test (1.16.x) (push) Has been cancelled
test / test (1.17.x) (push) Has been cancelled
Модуль переименован для публикации
2025-04-03 05:36:58 +03:00

24 строки
481 Б
Go

package godog
import (
"testing"
"time"
"git.golang1.ru/softonik/godog/internal/utils"
)
// this zeroes the time throughout whole test suite
// and makes it easier to assert output
// activated only when godog tests are being run
func init() {
utils.TimeNowFunc = func() time.Time {
return time.Time{}
}
}
func TestTimeNowFunc(t *testing.T) {
now := utils.TimeNowFunc()
if !now.IsZero() {
t.Fatalf("expected zeroed time, but got: %s", now.Format(time.RFC3339))
}
}