| 1 | // Copyright (c) 2022 Harry [Majored] [[email protected]] |
| 2 | // MIT License (https://github.com/Majored/rs-async-zip/blob/main/LICENSE) |
| 3 | |
| 4 | use craterust-analyzer cargo async_zip 0.0.18 crate/::baserust-analyzer cargo async_zip 0.0.18 base/::writerust-analyzer cargo async_zip 0.0.18 base/write/::iorust-analyzer cargo async_zip 0.0.18 base/write/io/::offsetrust-analyzer cargo async_zip 0.0.18 base/write/io/offset/::AsyncOffsetWriterrust-analyzer cargo async_zip 0.0.18 base/write/io/offset/AsyncOffsetWriter#; |
| 5 | |
| 6 | #[tokiorust-analyzer cargo tokio 1.25.0 crate/::testrust-analyzer cargo tokio-macros 1.8.0 test:] |
| 7 | async fn basicrust-analyzer cargo async_zip 0.0.18 tests/write/offset/basic().() { |
| 8 | use futures_literust-analyzer cargo futures-lite 2.1.0 crate/::iorust-analyzer cargo futures-lite 2.1.0 io/::AsyncWriteExtrust-analyzer cargo futures-lite 2.1.0 io/AsyncWriteExt#; |
| 9 | use futures_literust-analyzer cargo futures-lite 2.1.0 crate/::iorust-analyzer cargo futures-lite 2.1.0 io/::Cursorrust-analyzer cargo futures-lite 2.1.0 io/Cursor#; |
| 10 | |
| 11 | let mut writer = AsyncOffsetWriterrust-analyzer cargo async_zip 0.0.18 base/write/io/offset/AsyncOffsetWriter#::newrust-analyzer cargo async_zip 0.0.18 base/write/io/offset/impl#[`AsyncOffsetWriter<W>`]new().(Cursorrust-analyzer cargo futures-lite 2.1.0 io/Cursor#::newrust-analyzer cargo futures-lite 2.1.0 io/impl#[`Cursor<T>`]new().(Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]new().())); |
| 12 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(writer.offsetrust-analyzer cargo async_zip 0.0.18 base/write/io/offset/impl#[`AsyncOffsetWriter<W>`]offset().(), 0); |
| 13 | |
| 14 | writer.write_allrust-analyzer cargo futures-lite 2.1.0 io/AsyncWriteExt#write_all().(b"Foo. Bar. Foo. Bar.").rust-analyzer cargo futures-lite 2.1.0 io/impl#[`WriteAllFuture<'_, W>`][Future]poll().awaitrust-analyzer cargo futures-lite 2.1.0 io/impl#[`WriteAllFuture<'_, W>`][Future]poll()..expectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]expect().("failed to write data"); |
| 15 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(writer.offsetrust-analyzer cargo async_zip 0.0.18 base/write/io/offset/impl#[`AsyncOffsetWriter<W>`]offset().(), 19); |
| 16 | |
| 17 | writer.write_allrust-analyzer cargo futures-lite 2.1.0 io/AsyncWriteExt#write_all().(b"Foo. Foo.").rust-analyzer cargo futures-lite 2.1.0 io/impl#[`WriteAllFuture<'_, W>`][Future]poll().awaitrust-analyzer cargo futures-lite 2.1.0 io/impl#[`WriteAllFuture<'_, W>`][Future]poll()..expectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]expect().("failed to write data"); |
| 18 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(writer.offsetrust-analyzer cargo async_zip 0.0.18 base/write/io/offset/impl#[`AsyncOffsetWriter<W>`]offset().(), 28); |
| 19 | |
| 20 | writer.write_allrust-analyzer cargo futures-lite 2.1.0 io/AsyncWriteExt#write_all().(b"Bar. Bar.").rust-analyzer cargo futures-lite 2.1.0 io/impl#[`WriteAllFuture<'_, W>`][Future]poll().awaitrust-analyzer cargo futures-lite 2.1.0 io/impl#[`WriteAllFuture<'_, W>`][Future]poll()..expectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]expect().("failed to write data"); |
| 21 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(writer.offsetrust-analyzer cargo async_zip 0.0.18 base/write/io/offset/impl#[`AsyncOffsetWriter<W>`]offset().(), 37); |
| 22 | } |