在运行正常测试时,我们可以使用#[should_panic]宏来测试失败案例。#[tokio::test]的相应替代方案是什么
#[should_panic]
#[tokio::test]
发布于 2020-10-29 17:21:24
只需同时使用两个:
#[tokio::test] #[should_panic] async fn t1() { panic!("Nice panic!"); }
Playground
https://stackoverflow.com/questions/64586434
相似问题