(t *testing.T, s *Snapshot, b *bytes.Buffer, ppDir string)
| 1826 | } |
| 1827 | |
| 1828 | func testPanicMismatched(t *testing.T, s *Snapshot, b *bytes.Buffer, ppDir string) { |
| 1829 | if s.RemoteGOROOT != "" { |
| 1830 | t.Fatalf("RemoteGOROOT is %q", s.RemoteGOROOT) |
| 1831 | } |
| 1832 | if b.String() != "GOTRACEBACK=all\npanic: 42\n\n" { |
| 1833 | t.Fatalf("output: %q", b.String()) |
| 1834 | } |
| 1835 | ver := "/v2" |
| 1836 | if !internaltest.IsUsingModules() { |
| 1837 | ver = "" |
| 1838 | } |
| 1839 | want := []*Goroutine{ |
| 1840 | { |
| 1841 | Signature: Signature{ |
| 1842 | State: "running", |
| 1843 | Stack: Stack{ |
| 1844 | Calls: []Call{ |
| 1845 | newCallLocal( |
| 1846 | // This is important to note here that the Go runtime prints out |
| 1847 | // the package path, and not the package name. |
| 1848 | // |
| 1849 | // Here the package name is "correct". There is no way to deduce |
| 1850 | // this from the stack trace. |
| 1851 | "github.com/maruel/panicparse"+ver+"/cmd/panic/internal/incorrect.Panic", |
| 1852 | Args{}, |
| 1853 | pathJoin(ppDir, "internal", "incorrect", "correct.go"), |
| 1854 | 7), |
| 1855 | newCallLocal("main.init.func20", Args{}, pathJoin(ppDir, "main.go"), 314), |
| 1856 | newCallLocal("main.main", Args{}, pathJoin(ppDir, "main.go"), 340), |
| 1857 | }, |
| 1858 | }, |
| 1859 | }, |
| 1860 | ID: 1, |
| 1861 | First: true, |
| 1862 | }, |
| 1863 | } |
| 1864 | similarGoroutines(t, want, s.Goroutines) |
| 1865 | } |
| 1866 | |
| 1867 | func testPanicRace(t *testing.T, s *Snapshot, b *bytes.Buffer, ppDir string) { |
| 1868 | if s.RemoteGOROOT != "" { |
nothing calls this directly
no test coverage detected
searching dependent graphs…