Skip to content

Commit

Permalink
Add a test for size_of Option<ThreadId>
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonSapin committed Mar 20, 2019
1 parent 8cf720b commit c1d9191
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/libstd/thread/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1485,9 +1485,10 @@ fn _assert_sync_and_send() {
mod tests {
use super::Builder;
use crate::any::Any;
use crate::mem;
use crate::sync::mpsc::{channel, Sender};
use crate::result;
use crate::thread;
use crate::thread::{self, ThreadId};
use crate::time::Duration;
use crate::u32;

Expand Down Expand Up @@ -1717,6 +1718,11 @@ mod tests {
thread::sleep(Duration::from_millis(2));
}

#[test]
fn test_size_of_option_thread_id() {
assert_eq!(mem::size_of::<Option<ThreadId>>(), mem::size_of::<ThreadId>());
}

#[test]
fn test_thread_id_equal() {
assert!(thread::current().id() == thread::current().id());
Expand Down

0 comments on commit c1d9191

Please sign in to comment.