frp/utils/shutdown/shutdown_test.go

22 lines
248 B
Go
Raw Normal View History

2017-03-09 02:03:47 +08:00
package shutdown
import (
"testing"
"time"
)
func TestShutdown(t *testing.T) {
s := New()
go func() {
time.Sleep(time.Millisecond)
s.Start()
}()
s.WaitStart()
go func() {
time.Sleep(time.Millisecond)
s.Done()
}()
s.WaitDown()
}