OSDN Git Service

new repo
[bytom/vapor.git] / vendor / github.com / tendermint / tmlibs / common / service_test.go
1 package common
2
3 import (
4         "testing"
5 )
6
7 func TestBaseServiceWait(t *testing.T) {
8
9         type TestService struct {
10                 BaseService
11         }
12         ts := &TestService{}
13         ts.BaseService = *NewBaseService(nil, "TestService", ts)
14         ts.Start()
15
16         go func() {
17                 ts.Stop()
18         }()
19
20         for i := 0; i < 10; i++ {
21                 ts.Wait()
22         }
23
24 }