
Некоторые проверки провалились
test / test (1.16.x) (push) Has been cancelled
test / test (1.17.x) (push) Has been cancelled
24 строки
486 Б
Go
24 строки
486 Б
Go
package formatters
|
|
|
|
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))
|
|
}
|
|
}
|