(t *testing.T)
| 29 | } |
| 30 | |
| 31 | func TestTask_FailState(t *testing.T) { |
| 32 | tm := NewTaskManager() |
| 33 | |
| 34 | task := tm.Create("sess-1", 1, "upload") |
| 35 | tm.BindCommand("sess-1", 1, "cmd_001") |
| 36 | tm.Fail("sess-1", 1, "chunk 2 failed") |
| 37 | |
| 38 | if task.State != TaskFailed { |
| 39 | t.Errorf("state: got %v, want Failed", task.State) |
| 40 | } |
| 41 | if task.Error != "chunk 2 failed" { |
| 42 | t.Errorf("error: got %q, want %q", task.Error, "chunk 2 failed") |
| 43 | } |
| 44 | } |
| 45 | |
| 46 | func TestTask_TerminalStateIsIdempotent(t *testing.T) { |
| 47 | tm := NewTaskManager() |
nothing calls this directly
no test coverage detected