From 97a785023643359b82e8a177358b47acc3da170f Mon Sep 17 00:00:00 2001 From: emily Crandall Fleischman Date: Tue, 9 Jul 2024 17:19:40 -0400 Subject: [PATCH] add test --- tests/test_bytes.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/test_bytes.rs b/tests/test_bytes.rs index 017ce66ea..8e5d0ae1f 100644 --- a/tests/test_bytes.rs +++ b/tests/test_bytes.rs @@ -1173,6 +1173,15 @@ fn shared_is_unique() { assert!(c.is_unique()); } +#[test] +fn mut_shared_is_unique() { + let mut b = BytesMut::from(LONG); + let c = b.split().freeze(); + assert!(!c.is_unique()); + drop(b); + assert!(c.is_unique()); +} + #[test] fn test_bytesmut_from_bytes_static() { let bs = b"1b23exfcz3r";