|
|
@ -48,13 +48,13 @@ fn test_buffered_writer() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
#[test]
|
|
|
|
fn test_buffered_writer_inner_into_inner_does_not_flush() {
|
|
|
|
fn test_buffered_writer_inner_into_inner_flushes() {
|
|
|
|
task::block_on(async {
|
|
|
|
task::block_on(async {
|
|
|
|
let mut w = BufWriter::with_capacity(3, Vec::new());
|
|
|
|
let mut w = BufWriter::with_capacity(3, Vec::new());
|
|
|
|
w.write(&[0, 1]).await.unwrap();
|
|
|
|
w.write(&[0, 1]).await.unwrap();
|
|
|
|
assert_eq!(*w.get_ref(), []);
|
|
|
|
assert_eq!(*w.get_ref(), []);
|
|
|
|
let w = w.into_inner().await.unwrap();
|
|
|
|
let w = w.into_inner().await.unwrap();
|
|
|
|
assert_eq!(w, []);
|
|
|
|
assert_eq!(w, [0, 1]);
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|