From 8f8617b967de48008cc173a8cfa59fa4c4377170 Mon Sep 17 00:00:00 2001 From: bluss Date: Mon, 3 Dec 2018 18:40:08 +0100 Subject: [PATCH] TEST: Add test that Some(ArrayVec<[&_;_]>).is_some() This seems like a trivial test, but since it can fail, it shows us that we don't have a sound implementation yet. --- tests/tests.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/tests.rs b/tests/tests.rs index 3261df3..5a21829 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -164,6 +164,14 @@ fn test_compact_size() { assert!(mem::size_of::() <= 24); } +#[test] +fn test_still_works_with_option_arrayvec() { + type RefArray = ArrayVec<[&'static i32; 2]>; + let array = Some(RefArray::new()); + assert!(array.is_some()); + println!("{:?}", array); +} + #[test] fn test_drain() { let mut v = ArrayVec::from([0; 8]);