You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
Andrey Kovalev 7fe2f59f05
go mod tidy && go mod vendor
3 years ago
..
.gitignore go mod tidy && go mod vendor 3 years ago
.golangci.yml go mod tidy && go mod vendor 3 years ago
LICENSE go mod tidy && go mod vendor 3 years ago
Makefile go mod tidy && go mod vendor 3 years ago
README.md go mod tidy && go mod vendor 3 years ago
go.coverage.sh go mod tidy && go mod vendor 3 years ago
go.test.sh go mod tidy && go mod vendor 3 years ago
moment.go go mod tidy && go mod vendor 3 years ago
neo.go go mod tidy && go mod vendor 3 years ago
net.go go mod tidy && go mod vendor 3 years ago
ticker.go go mod tidy && go mod vendor 3 years ago
time.go go mod tidy && go mod vendor 3 years ago
timer.go go mod tidy && go mod vendor 3 years ago

README.md

neo

Package neo implements side effects (network, time) simulation for testing.

Wake up, Neo...

Replace side effects with explicit dependencies so you can sleep at night. Abuse time and network simulation in unit tests and reduce flaky, complicated and long integration tests.

package main

import (
	"fmt"
	"time"

	"github.com/gotd/neo"
)

func main() {
	// Set to current time.
	t := neo.NewTime(time.Now())

	// Travel to future.
	fmt.Println(t.Travel(time.Hour * 2).Format(time.RFC3339))
	// 2019-07-19T16:42:09+03:00

	// Back to past.
	fmt.Println(t.Travel(time.Hour * -2).Format(time.RFC3339))
	// 2019-07-19T14:42:09+03:00
}