From c33caddf572f12a73831b0ea95b3de703b0b0db9 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Fri, 9 Mar 2018 05:50:47 -0800 Subject: [PATCH] update tests --- src/payload.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/payload.rs b/src/payload.rs index d32e85a4..69f8aab6 100644 --- a/src/payload.rs +++ b/src/payload.rs @@ -556,21 +556,21 @@ mod tests { let (mut sender, payload) = Payload::new(false); let mut payload = PayloadHelper::new(payload); - assert_eq!(Async::NotReady, payload.readexactly(2).ok().unwrap()); + assert_eq!(Async::NotReady, payload.read_exact(2).ok().unwrap()); sender.feed_data(Bytes::from("line1")); sender.feed_data(Bytes::from("line2")); assert_eq!(Async::Ready(Some(Bytes::from_static(b"li"))), - payload.readexactly(2).ok().unwrap()); + payload.read_exact(2).ok().unwrap()); assert_eq!(payload.len, 3); assert_eq!(Async::Ready(Some(Bytes::from_static(b"ne1l"))), - payload.readexactly(4).ok().unwrap()); + payload.read_exact(4).ok().unwrap()); assert_eq!(payload.len, 4); sender.set_error(PayloadError::Incomplete); - payload.readexactly(10).err().unwrap(); + payload.read_exact(10).err().unwrap(); let res: Result<(), ()> = Ok(()); result(res) @@ -583,21 +583,21 @@ mod tests { let (mut sender, payload) = Payload::new(false); let mut payload = PayloadHelper::new(payload); - assert_eq!(Async::NotReady, payload.readuntil(b"ne").ok().unwrap()); + assert_eq!(Async::NotReady, payload.read_until(b"ne").ok().unwrap()); sender.feed_data(Bytes::from("line1")); sender.feed_data(Bytes::from("line2")); assert_eq!(Async::Ready(Some(Bytes::from("line"))), - payload.readuntil(b"ne").ok().unwrap()); + payload.read_until(b"ne").ok().unwrap()); assert_eq!(payload.len, 1); assert_eq!(Async::Ready(Some(Bytes::from("1line2"))), - payload.readuntil(b"2").ok().unwrap()); + payload.read_until(b"2").ok().unwrap()); assert_eq!(payload.len, 0); sender.set_error(PayloadError::Incomplete); - payload.readuntil(b"b").err().unwrap(); + payload.read_until(b"b").err().unwrap(); let res: Result<(), ()> = Ok(()); result(res)