diff options
Diffstat (limited to 'vendor/rayon-core/tests/double_init_fail.rs')
-rw-r--r-- | vendor/rayon-core/tests/double_init_fail.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/vendor/rayon-core/tests/double_init_fail.rs b/vendor/rayon-core/tests/double_init_fail.rs new file mode 100644 index 0000000..1591530 --- /dev/null +++ b/vendor/rayon-core/tests/double_init_fail.rs @@ -0,0 +1,15 @@ +use rayon_core::ThreadPoolBuilder; +use std::error::Error; + +#[test] +#[cfg_attr(any(target_os = "emscripten", target_family = "wasm"), ignore)] +fn double_init_fail() { + let result1 = ThreadPoolBuilder::new().build_global(); + assert!(result1.is_ok()); + let err = ThreadPoolBuilder::new().build_global().unwrap_err(); + assert!(err.source().is_none()); + assert_eq!( + err.to_string(), + "The global thread pool has already been initialized.", + ); +} |