From 48771770104641930719cc20fe5d50ca9957bbd8 Mon Sep 17 00:00:00 2001 From: eson <474420502@qq.com> Date: Wed, 28 Nov 2018 02:39:59 +0800 Subject: [PATCH] fuck go --- task.go | 2 +- task_test.go | 38 +++++++++++++++++++++++++++++++------- 2 files changed, 32 insertions(+), 8 deletions(-) diff --git a/task.go b/task.go index 0ad65f3..fbf180a 100644 --- a/task.go +++ b/task.go @@ -97,8 +97,8 @@ func (task *Task) ExecuteOnPlan() { for _, exec := range task.Plan.GetLoopValues() { iexec := exec.GetValue().(IExecute) if iexec.TimeTo() >= 0 { - iexec.CalculateTrigger() task.Execute() + iexec.CalculateTrigger() } } } diff --git a/task_test.go b/task_test.go index d76ad3e..0888206 100644 --- a/task_test.go +++ b/task_test.go @@ -30,13 +30,37 @@ func TestExecutePlan(t *testing.T) { time.Sleep(time.Second * 2) for _, task := range person.Tasks.GetLoopValues() { - for _, pr := range task.GetValue().(*Task).ExecuteOnPlan() { - if pr.OK { - log.Println(pr.Response.Content()[0:100]) - } else { - t.Error(pr.Error) - } - } + task.GetValue().(*Task).ExecuteOnPlan() } } + +type C interface { + Execute() +} + +type A struct { + C +} + +func (a *A) Execute() { + log.Println("A") +} + +func (a *A) EE() { + a.Execute() + a.Execute() +} + +type B struct { + A +} + +func (b *B) Execute() { + log.Println("B") +} + +func TestCase1(t *testing.T) { + b := B{} + b.EE() +}