Skip to content

Commit 64fdbfb

Browse files
authored
Test cloning tx after rx dropped (#377)
The test transfer_closed_sender will fail if issue 13 regresses, but this explicit test documents the expected behaviour better. Ref: #13
1 parent 6b8619f commit 64fdbfb

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/test.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -688,6 +688,13 @@ fn test_reentrant() {
688688
assert_eq!(null, receiver.recv().unwrap());
689689
}
690690

691+
#[test]
692+
fn clone_sender_after_receiver_dropped() {
693+
let (tx, rx) = ipc::channel::<u32>().unwrap();
694+
drop(rx);
695+
let _tx2 = tx.clone();
696+
}
697+
691698
#[test]
692699
fn transfer_closed_sender() {
693700
let (main_tx, main_rx) = ipc::channel().unwrap();

0 commit comments

Comments
 (0)