提交 f2c1789c 编写于 作者: A Alessandro Arzilli 提交者: Derek Parker

Changed TestIssue426 to work with go 1.8 (#627)

go1.8 changed the way anonymous struct names are generated for DWARF.
上级 a782abee
......@@ -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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册