Skip to content

Commit

Permalink
proc_test: line numbering changed
Browse files Browse the repository at this point in the history
  • Loading branch information
aarzilli authored and derekparker committed Aug 1, 2017
1 parent 1e3ff49 commit 038fd33
Showing 1 changed file with 44 additions and 15 deletions.
59 changes: 44 additions & 15 deletions pkg/proc/proc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -580,13 +580,28 @@ func TestNextFunctionReturn(t *testing.T) {
}

func TestNextFunctionReturnDefer(t *testing.T) {
testcases := []nextTest{
{5, 8},
{8, 9},
{9, 10},
{10, 6},
{6, 7},
{7, 8},
var testcases []nextTest

ver, _ := proc.ParseVersionString(runtime.Version())

if ver.Major < 0 || ver.AfterOrEqual(proc.GoVersion{1, 9, -1, 0, 0, ""}) {
testcases = []nextTest{
{5, 6},
{6, 9},
{9, 10},
{10, 6},
{6, 7},
{7, 8},
}
} else {
testcases = []nextTest{
{5, 8},
{8, 9},
{9, 10},
{10, 6},
{6, 7},
{7, 8},
}
}
protest.AllowRecording(t)
testseq("testnextdefer", contNext, testcases, "main.main", t)
Expand Down Expand Up @@ -2169,14 +2184,28 @@ func TestStepCallPtr(t *testing.T) {
func TestStepReturnAndPanic(t *testing.T) {
// Tests that Step works correctly when returning from functions
// and when a deferred function is called when panic'ing.
testseq("defercall", contStep, []nextTest{
{17, 5},
{5, 6},
{6, 7},
{7, 18},
{18, 5},
{5, 6},
{6, 7}}, "", t)
ver, _ := goversion.Parse(runtime.Version())
if ver.Major < 0 || ver.AfterOrEqual(goversion.GoVersion{1, 9, -1, 0, 0, ""}) {
testseq("defercall", contStep, []nextTest{
{17, 5},
{5, 6},
{6, 7},
{7, 17},
{17, 18},
{18, 5},
{5, 6},
{6, 7}}, "", t)

} else {
testseq("defercall", contStep, []nextTest{
{17, 5},
{5, 6},
{6, 7},
{7, 18},
{18, 5},
{5, 6},
{6, 7}}, "", t)
}
}

func TestStepDeferReturn(t *testing.T) {
Expand Down

0 comments on commit 038fd33

Please sign in to comment.