1 #![cfg(all(feature = "full", not(target_os = "wasi")))] // Wasi doesn't support threading 2 3 #[allow(unused_imports)] 4 use std as tokio; 5 6 use ::tokio as tokio1; 7 8 mod test { 9 pub use ::tokio; 10 } 11 compute() -> usize12async fn compute() -> usize { 13 let join = tokio1::spawn(async { 1 }); 14 join.await.unwrap() 15 } 16 17 #[tokio1::main(crate = "tokio1")] compute_main() -> usize18async fn compute_main() -> usize { 19 compute().await 20 } 21 22 #[test] crate_rename_main()23fn crate_rename_main() { 24 assert_eq!(1, compute_main()); 25 } 26 27 #[tokio1::test(crate = "tokio1")] crate_rename_test()28async fn crate_rename_test() { 29 assert_eq!(1, compute().await); 30 } 31 32 #[test::tokio::test(crate = "test::tokio")] crate_path_test()33async fn crate_path_test() { 34 assert_eq!(1, compute().await); 35 } 36