优化结构
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user