2
0

worker_test.go 353 B

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