Closed hzwwen closed 5 years ago
Hi, according to originally posted by @mdwhatcott in https://github.com/smartystreets/goconvey/issues/364#issuecomment-157253491. I found some unexpected output from the code below.
func TestName(t *testing.T) { call1 := 0 call2 := 0 convey.Convey("root", t, func(c convey.C) { for i := 0; i < 3; i++ { c.Convey(fmt.Sprintf("i: %d", i), func(c convey.C) { call2++ }) } call1 ++ }) t.Logf("call1: %d", call1) // call1: 3 why the output is 3? 1 are expected. t.Logf("call2: %d", call2) // call1: 3 }
@hzwwen - Wow, not sure.
https://github.com/smartystreets/goconvey/wiki/Execution-order
@cbandy Thanks.
Hi, according to originally posted by @mdwhatcott in https://github.com/smartystreets/goconvey/issues/364#issuecomment-157253491. I found some unexpected output from the code below.