fix/hide typo

This commit is contained in:
Bahex 2024-12-21 06:48:07 +03:00
parent 9fef87cd4b
commit ddd30c5fc2

View file

@ -233,7 +233,8 @@ mod test {
#[test] #[test]
fn chunk_read() { fn chunk_read() {
let data = Cursor::new("hello world"); let s = "hello world";
let data = Cursor::new(s);
let chunk_read = ChunkRead { let chunk_read = ChunkRead {
reader: data, reader: data,
size: NonZeroUsize::new(4).unwrap(), size: NonZeroUsize::new(4).unwrap(),
@ -241,15 +242,16 @@ mod test {
let chunks = chunk_read.map(|e| e.unwrap()).collect::<Vec<_>>(); let chunks = chunk_read.map(|e| e.unwrap()).collect::<Vec<_>>();
assert_eq!( assert_eq!(
chunks, chunks,
[b"hell".to_vec(), b"o wo".to_vec(), b"rld".to_vec()] [s[..4].as_bytes(), s[4..8].as_bytes(), s[8..].as_bytes()]
); );
} }
#[test] #[test]
fn chunk_read_stream() { fn chunk_read_stream() {
let data = Cursor::new("hel") let s = "hello world";
.chain(Cursor::new("lo wor")) let data = Cursor::new(&s[..3])
.chain(Cursor::new("ld")); .chain(Cursor::new(&s[3..9]))
.chain(Cursor::new(&s[9..]));
let chunk_read = ChunkRead { let chunk_read = ChunkRead {
reader: data, reader: data,
size: NonZeroUsize::new(4).unwrap(), size: NonZeroUsize::new(4).unwrap(),
@ -257,7 +259,7 @@ mod test {
let chunks = chunk_read.map(|e| e.unwrap()).collect::<Vec<_>>(); let chunks = chunk_read.map(|e| e.unwrap()).collect::<Vec<_>>();
assert_eq!( assert_eq!(
chunks, chunks,
[b"hell".to_vec(), b"o wo".to_vec(), b"rld".to_vec()] [s[..4].as_bytes(), s[4..8].as_bytes(), s[8..].as_bytes()]
); );
} }