(t *testing.T)
| 475 | } |
| 476 | |
| 477 | func TestPutToOutputSnapshotsBaseline(t *testing.T) { |
| 478 | ctx, cancel := context.WithCancel(context.Background()) |
| 479 | defer cancel() |
| 480 | pool := newTestBasePool(ctx, cancel) |
| 481 | |
| 482 | bl := newTestBaseline() |
| 483 | bl.Frameworks = common.Frameworks{ |
| 484 | "nginx": common.NewFramework("nginx", common.FrameFromFingers), |
| 485 | } |
| 486 | bl.Title = "before" |
| 487 | pool.putToOutput(bl) |
| 488 | |
| 489 | got := <-pool.OutputCh |
| 490 | pool.Outwg.Done() |
| 491 | bl.Title = "after" |
| 492 | bl.Frameworks["apache"] = common.NewFramework("apache", common.FrameFromFingers) |
| 493 | |
| 494 | if got.Title != "before" { |
| 495 | t.Fatalf("snapshot title = %q, want before", got.Title) |
| 496 | } |
| 497 | if _, ok := got.Frameworks["apache"]; ok { |
| 498 | t.Fatal("output snapshot shares Frameworks map with original baseline") |
| 499 | } |
| 500 | } |
| 501 | |
| 502 | func TestPutToOutput_AfterCancel(t *testing.T) { |
| 503 | ctx, cancel := context.WithCancel(context.Background()) |
nothing calls this directly
no test coverage detected