Skip to content

Commit

Permalink
Add tests for asserting Send + Sync in
Browse files Browse the repository at this point in the history
CompoundFile
  • Loading branch information
surban committed Nov 26, 2023
1 parent 5610320 commit b6d8359
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -769,3 +769,18 @@ fn drop_compound_file_with_stream_open() -> io::Result<()> {
}

//===========================================================================//
// Tests for asserting Send + Sync:

#[test]
fn test_compound_file_send() {
fn assert_send<T: Send>() {}
assert_send::<CompoundFile<std::fs::File>>();
}

#[test]
fn test_compound_file_sync() {
fn assert_sync<T: Sync>() {}
assert_sync::<CompoundFile<std::fs::File>>();
}

//===========================================================================//

0 comments on commit b6d8359

Please sign in to comment.