From 1e4d6dd5d69ffc20b202d5aaad6565a4ea43ae8c Mon Sep 17 00:00:00 2001 From: Avril Date: Wed, 10 Jun 2020 00:15:19 +0100 Subject: [PATCH] reinterpret test ok --- src/lib.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 6188eec..70e880a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -24,6 +24,18 @@ mod tests { } struct Unit; + + #[test] + fn reinterpret() + { + let heap = heap![u8; 32]; + unsafe { + let heap = heap.reinterpret::(); + assert_eq!(heap.len(), 8); + let heap = heap.reinterpret::(); + assert_eq!(heap.len(), 32); + } + } #[test] fn zero_size() {