优化结构

This commit is contained in:
Yvan
2026-08-23 07:48:02 +08:00
parent 40632c5756
commit 7a9a738c6a
15 changed files with 590 additions and 83 deletions
+11
View File
@@ -95,3 +95,14 @@ func TestRunMethodHonorsDeadlineWhenMethodIgnoresContext(t *testing.T) {
}
close(release)
}
func TestRunHandlesNilTask(t *testing.T) {
executor := &TaskExecutor{}
log := executor.Run(context.Background(), nil, "manual")
if log == nil {
t.Fatal("Run() returned nil log")
}
if log.Status != "fail" || log.ErrorMsg != "任务不能为空" {
t.Fatalf("Run() log = %#v, want a failed nil-task result", log)
}
}