tendermint/blockchain/v2/routines_test.go

23 lines
297 B
Go
Raw Normal View History

2019-07-25 16:02:47 +02:00
package v2
import (
2019-07-27 10:58:58 +02:00
"fmt"
2019-07-25 16:02:47 +02:00
"testing"
2019-07-27 10:58:58 +02:00
"time"
2019-07-25 16:02:47 +02:00
)
func TestReactor(t *testing.T) {
2019-07-27 10:58:58 +02:00
reactor := DummyReactor{}
2019-07-25 16:02:47 +02:00
reactor.Start()
script := Events{
testEvent{},
}
for _, event := range script {
reactor.Receive(event)
}
2019-07-27 10:58:58 +02:00
fmt.Println("sleeping")
time.Sleep(5 * time.Second)
2019-07-25 16:02:47 +02:00
reactor.Stop()
}