Add a test for size_of Option<ThreadId>
This commit is contained in:
parent
8cf720bd19
commit
c1d9191fa5
1 changed files with 7 additions and 1 deletions
|
|
@ -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;
|
||||
|
||||
|
|
@ -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());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue