diff --git a/tests/test_bytes.rs b/tests/test_bytes.rs index 5d01b5b82..c6d255472 100644 --- a/tests/test_bytes.rs +++ b/tests/test_bytes.rs @@ -141,6 +141,14 @@ fn slice() { assert_eq!(b, b"lo world"[..]); } +#[test] +fn slice_with_excluded_start() { + use core::ops::Bound::Excluded; + + let bytes = Bytes::from_static(b"hello"); + assert_eq!(&bytes.slice((Excluded(1), Excluded(4)))[..], b"ll"); +} + #[test] #[should_panic] fn slice_oob_1() {