use super::*; #[test] fn test_u8_panic() { let other_core_id = prepare_on_fixed_core(); let receiver: Access>, Blocking> = Default::default(); let sender: Access>, Blocking> = Arc::clone(&receiver).into(); let handle = thread::spawn(move || { if_provided_set_core_affinity(other_core_id); let editor: Editor = sender.edit().unwrap(); intentionally_panic_while_holding(editor); }); assert!(receiver.await_result().is_err()); assert!(!receiver.edit().unwrap_err().into_inner().has()); await_completion(handle); } #[test] fn test_u8_transfer_panic() { let other_core_id = prepare_on_fixed_core(); let receiver: Access>, Blocking> = Default::default(); let sender: Access>, Instantly> = Arc::clone(&receiver).into(); let handle = thread::spawn(move || { if_provided_set_core_affinity(other_core_id); let mut editor: Editor = sender.try_edit().unwrap(); editor.set(43u8); intentionally_panic_while_holding(editor); }); assert!(receiver.await_result().is_err()); assert_eq!(receiver.edit().unwrap_err().into_inner().take(), Some(43u8)); await_completion(handle); }