(t *testing.T)
| 8 | ) |
| 9 | |
| 10 | func TestTask_Lifecycle(t *testing.T) { |
| 11 | tm := NewTaskManager() |
| 12 | |
| 13 | task := tm.Create("sess-1", 1, "exec") |
| 14 | if task.State != TaskPending { |
| 15 | t.Errorf("initial state: got %v, want Pending", task.State) |
| 16 | } |
| 17 | |
| 18 | // Bind a command transitions to Running. |
| 19 | tm.BindCommand("sess-1", 1, "cmd_001") |
| 20 | if task.State != TaskRunning { |
| 21 | t.Errorf("after bind: got %v, want Running", task.State) |
| 22 | } |
| 23 | |
| 24 | // Complete. |
| 25 | tm.Complete("sess-1", 1) |
| 26 | if task.State != TaskCompleted { |
| 27 | t.Errorf("after complete: got %v, want Completed", task.State) |
| 28 | } |
| 29 | } |
| 30 | |
| 31 | func TestTask_FailState(t *testing.T) { |
| 32 | tm := NewTaskManager() |
nothing calls this directly
no test coverage detected