MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / TestTask_Lifecycle

Function TestTask_Lifecycle

internal/bridge/taskmanager_test.go:10–29  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

8)
9
10func 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
31func TestTask_FailState(t *testing.T) {
32 tm := NewTaskManager()

Callers

nothing calls this directly

Calls 4

CreateMethod · 0.95
BindCommandMethod · 0.95
CompleteMethod · 0.95
NewTaskManagerFunction · 0.85

Tested by

no test coverage detected