Skip to content

Commit

Permalink
Test cloning tx after rx dropped (#377)
Browse files Browse the repository at this point in the history
The test transfer_closed_sender will fail if issue 13 regresses, but
this explicit test documents the expected behaviour better.

Ref: #13
  • Loading branch information
glyn authored Dec 21, 2024
1 parent 6b8619f commit 64fdbfb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,13 @@ fn test_reentrant() {
assert_eq!(null, receiver.recv().unwrap());
}

#[test]
fn clone_sender_after_receiver_dropped() {
let (tx, rx) = ipc::channel::<u32>().unwrap();
drop(rx);
let _tx2 = tx.clone();
}

#[test]
fn transfer_closed_sender() {
let (main_tx, main_rx) = ipc::channel().unwrap();
Expand Down

0 comments on commit 64fdbfb

Please sign in to comment.