(t *testing.T)
| 316 | } |
| 317 | |
| 318 | func TestServiceName(t *testing.T) { |
| 319 | s := NewIdleService(nil, nil).WithName("test name") |
| 320 | require.Equal(t, "test name", DescribeService(s)) |
| 321 | |
| 322 | ctx, cancel := context.WithCancel(context.Background()) |
| 323 | defer cancel() |
| 324 | require.NoError(t, s.StartAsync(ctx)) |
| 325 | |
| 326 | // once service has started, BasicService will not allow changing the name |
| 327 | s.WithName("new") |
| 328 | require.Equal(t, "test name", DescribeService(s)) |
| 329 | } |
| 330 | |
| 331 | func TestListenerCancellationUnstartedService(t *testing.T) { |
| 332 | defer goleak.VerifyNone(t) |
nothing calls this directly
no test coverage detected