(t *testing.T)
| 85 | } |
| 86 | |
| 87 | func TestParseCache_Reparsing(t *testing.T) { |
| 88 | skipIfNoParseCache(t) |
| 89 | |
| 90 | defer func(padding int) { |
| 91 | parsePadding = padding |
| 92 | }(parsePadding) |
| 93 | parsePadding = 0 |
| 94 | |
| 95 | files := dummyFileHandles(parseCacheMinFiles) |
| 96 | danglingSelector := []byte("package p\nfunc _() {\n\tx.\n}") |
| 97 | files = append(files, makeFakeFileHandle("file:///bad1", danglingSelector)) |
| 98 | files = append(files, makeFakeFileHandle("file:///bad2", danglingSelector)) |
| 99 | |
| 100 | // Parsing should succeed even though we overflow the padding. |
| 101 | cache := newParseCache(0) |
| 102 | _, err := cache.parseFiles(context.Background(), token.NewFileSet(), parsego.Full, false, files...) |
| 103 | if err != nil { |
| 104 | t.Fatal(err) |
| 105 | } |
| 106 | } |
| 107 | |
| 108 | // Re-parsing the first file should not panic. |
| 109 | func TestParseCache_Issue59097(t *testing.T) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…