worker_test.go 310 B

123456789101112131415161718192021222324
  1. package worker
  2. import (
  3. "testing"
  4. "github.com/google/uuid"
  5. "go.uber.org/goleak"
  6. )
  7. func TestWorker(t *testing.T) {
  8. defer goleak.VerifyNone(t)
  9. uuid, err := uuid.NewUUID()
  10. if err != nil {
  11. panic(err)
  12. }
  13. workerPool := make(chan chan Job, 10)
  14. w := NewWorker(uuid, workerPool)
  15. w.Start()
  16. w.Stop()
  17. }