(t *testing.T)
| 209 | } |
| 210 | |
| 211 | func TestParseStack(t *testing.T) { |
| 212 | tests := []struct { |
| 213 | name string |
| 214 | give string |
| 215 | |
| 216 | id int |
| 217 | state string |
| 218 | firstFunc string |
| 219 | funcs []string |
| 220 | }{ |
| 221 | { |
| 222 | name: "running", |
| 223 | give: joinLines( |
| 224 | "goroutine 1 [running]:", |
| 225 | "example.com/foo/bar.baz()", |
| 226 | " example.com/foo/bar.go:123", |
| 227 | ), |
| 228 | id: 1, |
| 229 | state: "running", |
| 230 | firstFunc: "example.com/foo/bar.baz", |
| 231 | funcs: []string{"example.com/foo/bar.baz"}, |
| 232 | }, |
| 233 | { |
| 234 | name: "without position", |
| 235 | give: joinLines( |
| 236 | "goroutine 1 [running]:", |
| 237 | "example.com/foo/bar.baz()", |
| 238 | // Oops, no "file:line" entry for this function. |
| 239 | "example.com/foo/bar.qux()", |
| 240 | " example.com/foo/bar.go:456", |
| 241 | ), |
| 242 | id: 1, |
| 243 | state: "running", |
| 244 | firstFunc: "example.com/foo/bar.baz", |
| 245 | funcs: []string{ |
| 246 | "example.com/foo/bar.baz", |
| 247 | "example.com/foo/bar.qux", |
| 248 | }, |
| 249 | }, |
| 250 | { |
| 251 | name: "created by", |
| 252 | give: joinLines( |
| 253 | "goroutine 1 [running]:", |
| 254 | "example.com/foo/bar.baz()", |
| 255 | " example.com/foo/bar.go:123", |
| 256 | "created by example.com/foo/bar.qux", |
| 257 | " example.com/foo/bar.go:456", |
| 258 | ), |
| 259 | id: 1, |
| 260 | state: "running", |
| 261 | firstFunc: "example.com/foo/bar.baz", |
| 262 | funcs: []string{ |
| 263 | "example.com/foo/bar.baz", |
| 264 | }, |
| 265 | }, |
| 266 | } |
| 267 | |
| 268 | for _, tt := range tests { |
nothing calls this directly
no test coverage detected
searching dependent graphs…