(t *testing.T)
| 264 | } |
| 265 | |
| 266 | func TestTask_ListBySession(t *testing.T) { |
| 267 | tm := NewTaskManager() |
| 268 | tm.Create("sess-1", 1, "exec") |
| 269 | tm.Create("sess-1", 2, "netstat") |
| 270 | tm.Create("sess-2", 3, "ls") |
| 271 | |
| 272 | list := tm.ListBySession("sess-1") |
| 273 | if len(list) != 2 { |
| 274 | t.Errorf("ListBySession sess-1: got %d, want 2", len(list)) |
| 275 | } |
| 276 | |
| 277 | list = tm.ListBySession("sess-2") |
| 278 | if len(list) != 1 { |
| 279 | t.Errorf("ListBySession sess-2: got %d, want 1", len(list)) |
| 280 | } |
| 281 | |
| 282 | list = tm.ListBySession("nonexistent") |
| 283 | if len(list) != 0 { |
| 284 | t.Errorf("ListBySession nonexistent: got %d, want 0", len(list)) |
| 285 | } |
| 286 | } |
| 287 | |
| 288 | func TestTask_ActiveBySession(t *testing.T) { |
| 289 | tm := NewTaskManager() |
nothing calls this directly
no test coverage detected