--------------------------------------------------------------------------- addAddition ---------------------------------------------------------------------------
(t *testing.T)
| 65 | // --------------------------------------------------------------------------- |
| 66 | |
| 67 | func TestAddAddition_Normal(t *testing.T) { |
| 68 | ctx, cancel := context.WithCancel(context.Background()) |
| 69 | defer cancel() |
| 70 | pool := newTestBasePool(ctx, cancel) |
| 71 | |
| 72 | pool.addAddition(&Unit{path: "/a", source: parsers.WordSource}) |
| 73 | |
| 74 | select { |
| 75 | case u := <-pool.additionCh: |
| 76 | if u.path != "/a" { |
| 77 | t.Fatalf("path = %q, want /a", u.path) |
| 78 | } |
| 79 | case <-time.After(time.Second): |
| 80 | t.Fatal("addAddition: channel receive timed out") |
| 81 | } |
| 82 | pool.wg.Done() // balance the Add(1) |
| 83 | pool.wg.Wait() // must not hang |
| 84 | } |
| 85 | |
| 86 | func TestAppendBasePathTreatsValidPathAsDirectory(t *testing.T) { |
| 87 | tests := []struct { |
nothing calls this directly
no test coverage detected