Changed TestIssue426 to work with go 1.8 (#627)

go1.8 changed the way anonymous struct names are generated for DWARF.
This commit is contained in:
Alessandro Arzilli 2016-09-06 19:26:56 +02:00 committed by Derek Parker
parent a782abee90
commit f2c1789c64

@ -2,6 +2,7 @@ package servicetest
import (
"fmt"
"runtime"
"sort"
"strings"
"testing"
@ -735,6 +736,14 @@ func TestIssue426(t *testing.T) {
{"anoniface1", `interface { OtherFunction(int, int); SomeFunction(struct { val go/constant.Value }) }`},
}
ver, _ := proc.ParseVersionString(runtime.Version())
if ver.Major < 0 || ver.AfterOrEqual(proc.GoVersion{1, 8, -1, 0, 0}) {
testcases[2].typ = `struct { main.val go/constant.Value }`
testcases[3].typ = `func(struct { main.i int }, interface {}, struct { main.val go/constant.Value })`
testcases[4].typ = `struct { main.i int; main.j int }`
testcases[5].typ = `interface { OtherFunction(int, int); SomeFunction(struct { main.val go/constant.Value }) }`
}
// Serialization of type expressions (go/ast.Expr) containing anonymous structs or interfaces
// differs from the serialization used by the linker to produce DWARF type information
withTestProcess("testvariables2", t, func(p *proc.Process, fixture protest.Fixture) {