1use rayon_core::ThreadPoolBuilder;
2use std::error::Error;
3
4#[test]
5#[cfg_attr(any(target_os = "emscripten", target_family = "wasm"), ignore)]
6fn double_init_fail() {
7 let result1 = ThreadPoolBuilder::new().build_global();
8 assert!(result1.is_ok());
9 let err = ThreadPoolBuilder::new().build_global().unwrap_err();
10 assert!(err.source().is_none());
11 assert_eq!(
12 err.to_string(),
13 "The global thread pool has already been initialized.",
14 );
15}
16