| ... | @@ -692,14 +692,15 @@ test "read from a file using Batch.awaitAsync API" { | ... | @@ -692,14 +692,15 @@ test "read from a file using Batch.awaitAsync API" { |
| 692 | var storage: [2]Io.Operation.Storage = undefined; | 692 | var storage: [2]Io.Operation.Storage = undefined; |
| 693 | var batch: Io.Batch = .init(&storage); | 693 | var batch: Io.Batch = .init(&storage); |
| 694 | | 694 | |
| 695 | batch.addAt(0, .{ .file_read_streaming = .{ | 695 | // Tests add API because this provides coverage for both add and addAt. |
| | 696 | try testing.expectEqual(0, batch.add(.{ .file_read_streaming = .{ |
| 696 | .file = eyes_file, | 697 | .file = eyes_file, |
| 697 | .data = &.{&eyes_buf}, | 698 | .data = &.{&eyes_buf}, |
| 698 | } }); | 699 | } })); |
| 699 | batch.addAt(1, .{ .file_read_streaming = .{ | 700 | try testing.expectEqual(1, batch.add(.{ .file_read_streaming = .{ |
| 700 | .file = saviour_file, | 701 | .file = saviour_file, |
| 701 | .data = &.{&saviour_buf}, | 702 | .data = &.{&saviour_buf}, |
| 702 | } }); | 703 | } })); |
| 703 | | 704 | |
| 704 | // This API is supposed to *always* work even if the target has no | 705 | // This API is supposed to *always* work even if the target has no |
| 705 | // concurrency primitives available. | 706 | // concurrency primitives available. |