(t *testing.T)
| 147 | } |
| 148 | |
| 149 | func TestClose(t *testing.T) { |
| 150 | eb := NewEventBus() |
| 151 | ch := eb.Subscribe([]types.AgentChannel{types.ChannelProgress}, nil) |
| 152 | |
| 153 | eb.Close() |
| 154 | |
| 155 | // Channel should be closed |
| 156 | select { |
| 157 | case _, ok := <-ch: |
| 158 | if ok { |
| 159 | t.Error("channel should be closed") |
| 160 | } |
| 161 | case <-time.After(100 * time.Millisecond): |
| 162 | t.Error("channel read should not block") |
| 163 | } |
| 164 | } |
| 165 | |
| 166 | // TestGetTimelineRange 测试分页获取时间线 |
| 167 | func TestGetTimelineRange(t *testing.T) { |
nothing calls this directly
no test coverage detected