dwarf/line: fix TestDebugLinePrologueParser test for Go 1.14 (#1891)
Go 1.14 has more fake file names, apparently (also go fmt).
This commit is contained in:
parent
7560c33819
commit
14733084a8
@ -114,10 +114,10 @@ func testDebugLinePrologueParser(p string, t *testing.T) {
|
||||
}
|
||||
|
||||
for _, ln := range dbl.Lookup {
|
||||
if ln.Path == "<autogenerated>" {
|
||||
if ln.Path == "<autogenerated>" || strings.HasPrefix(ln.Path, "<missing>_") || ln.Path == "_gomod_.go" {
|
||||
continue
|
||||
}
|
||||
if _, err := os.Stat(ln.Path); err != nil {
|
||||
if _, err := os.Stat(ln.Path); err != nil {
|
||||
t.Fatalf("Invalid input path %s: %s\n", ln.Path, err)
|
||||
}
|
||||
}
|
||||
@ -299,7 +299,7 @@ func BenchmarkPCToLine(b *testing.B) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestDebugLineC(t * testing.T) {
|
||||
func TestDebugLineC(t *testing.T) {
|
||||
p, err := filepath.Abs("../../../_fixtures/debug_line_c_data")
|
||||
if err != nil {
|
||||
t.Fatal("Could not find test data", p, err)
|
||||
@ -316,9 +316,9 @@ func TestDebugLineC(t * testing.T) {
|
||||
t.Fatal("Parser result is empty")
|
||||
}
|
||||
|
||||
file := []string{"main.c", "/mnt/c/develop/delve/_fixtures/main.c" ,"/usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h",
|
||||
"/usr/include/x86_64-linux-gnu/bits/types.h" ,"/usr/include/x86_64-linux-gnu/bits/libio.h", "/usr/include/stdio.h",
|
||||
"/usr/include/x86_64-linux-gnu/bits/sys_errlist.h"}
|
||||
file := []string{"main.c", "/mnt/c/develop/delve/_fixtures/main.c", "/usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h",
|
||||
"/usr/include/x86_64-linux-gnu/bits/types.h", "/usr/include/x86_64-linux-gnu/bits/libio.h", "/usr/include/stdio.h",
|
||||
"/usr/include/x86_64-linux-gnu/bits/sys_errlist.h"}
|
||||
|
||||
for _, ln := range parsed {
|
||||
if len(ln.FileNames) == 0 {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user