Skip to content

Commit c32fc60

Browse files
author
Oli Iliffe
committed
Add test for available_parallelism()
This is a redo of (this PR)[#104095]. Add test for available_parallelism Add test for available_parallelism
1 parent 6c6d210 commit c32fc60

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

library/std/tests/thread.rs

+8
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,11 @@ fn thread_local_containing_const_statements() {
3737
assert_eq!(CELL.get(), 1);
3838
assert_eq!(REFCELL.take(), 1);
3939
}
40+
41+
#[test]
42+
// Include an ignore list on purpose, so that new platforms don't miss it
43+
#[cfg_attr(any(target_os = "redox", target_os = "l4re"), should_panic)]
44+
fn available_parallelism() {
45+
// check that std::thread::available_parallelism() returns a valid value
46+
assert!(thread::available_parallelism().is_ok());
47+
}

0 commit comments

Comments
 (0)