diff --git a/hunter.go b/hunter.go index 284d86e..2e99fa6 100644 --- a/hunter.go +++ b/hunter.go @@ -116,7 +116,7 @@ func (hunter *Hunter) recursionTasks(cxt *TaskContext) { tasknode := itask.(ITaskNode) task := tasknode.Task() - ncxt.curPath = cxt.parent.Path() + ncxt.curPath = cxt.current.Path() if itid, ok := task.(IIdentity); ok { ncxt.curTaskID = itid.GetID() } else { @@ -134,7 +134,7 @@ func (hunter *Hunter) recursionTasks(cxt *TaskContext) { after.After(cxt) } - tasknode.SetPath(cxt.parent.Path() + "." + ncxt.curTaskID) + tasknode.SetPath(cxt.current.Path() + "." + ncxt.curTaskID) ncxt.parent = cxt.current ncxt.current = tasknode hunter.recursionTasks(ncxt) diff --git a/hunter_test.go b/hunter_test.go index c35848e..218dba2 100644 --- a/hunter_test.go +++ b/hunter_test.go @@ -2,9 +2,14 @@ package hunter import ( "encoding/json" + "log" "testing" ) +func init() { + log.Println("测试最好使用 docker run -p 80:80 kennethreitz/httpbin") +} + type WebGet struct { PreGetUrl }