diff --git a/tests/test.rs b/tests/test.rs index 5ba1cc49b..3b5641156 100644 --- a/tests/test.rs +++ b/tests/test.rs @@ -297,6 +297,14 @@ fn test_unique_to_shared_ptr_cpp_type() { assert_eq!(&*shared as *const _, ptr); } +#[test] +fn test_unique_to_shared_ptr_null() { + let unique = cxx::UniquePtr::::null(); + assert!(unique.is_null()); + let shared = unique.to_shared(); + assert!(shared.is_null()); +} + #[test] fn test_c_ns_method_calls() { let unique_ptr = ffi2::ns_c_return_unique_ptr_ns();