From 35f543b0db7376cbb4207a77e80258b70dc0be36 Mon Sep 17 00:00:00 2001 From: Renan Pimentel Date: Thu, 22 Oct 2026 18:17:41 -0300 Subject: [PATCH] test: cover excluded start bound in Bytes::slice --- tests/test_bytes.rs | 8 ++++++++ 1 file changed, 8 insertions(+) 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() {