1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-04-11 11:02:02 +02:00
2021-01-20 21:01:10 +00:00

31 lines
425 B
Go

package memory
import (
"testing"
"github.com/asim/go-micro/v3/registry"
)
func TestWatcher(t *testing.T) {
w := &Watcher{
id: "test",
res: make(chan *registry.Result),
exit: make(chan bool),
}
go func() {
w.res <- &registry.Result{}
}()
_, err := w.Next()
if err != nil {
t.Fatal("unexpected err", err)
}
w.Stop()
if _, err := w.Next(); err == nil {
t.Fatal("expected error on Next()")
}
}