(t *testing.T)
| 1278 | } |
| 1279 | |
| 1280 | func Test_Observable_Map_Parallel(t *testing.T) { |
| 1281 | defer goleak.VerifyNone(t) |
| 1282 | ctx, cancel := context.WithCancel(context.Background()) |
| 1283 | defer cancel() |
| 1284 | const len = 10 |
| 1285 | ch := make(chan Item, len) |
| 1286 | go func() { |
| 1287 | for i := 0; i < len; i++ { |
| 1288 | ch <- Of(i) |
| 1289 | } |
| 1290 | close(ch) |
| 1291 | }() |
| 1292 | |
| 1293 | obs := FromChannel(ch).Map(func(_ context.Context, i interface{}) (interface{}, error) { |
| 1294 | return i.(int) + 1, nil |
| 1295 | }, WithPool(len)) |
| 1296 | Assert(ctx, t, obs, HasItemsNoOrder(1, 2, 3, 4, 5, 6, 7, 8, 9, 10), HasNoError()) |
| 1297 | } |
| 1298 | |
| 1299 | func Test_Observable_Marshal(t *testing.T) { |
| 1300 | defer goleak.VerifyNone(t) |
nothing calls this directly
no test coverage detected
searching dependent graphs…