This commit is contained in:
Rob Ede 2021-10-19 15:41:29 +01:00
parent 5b1a032fad
commit 5fc43f5ab5
No known key found for this signature in database
GPG Key ID: 97C636207D3EF933
1 changed files with 15 additions and 0 deletions

View File

@ -0,0 +1,15 @@
//! Checks that test macro does not cause problems in the presence of imports named "test" that
//! could be either a module with test items or the "test with runtime" macro itself.
//!
//! Before actix/actix-net#399 was implemented, this macro was running twice. The first run output
//! `#[test]` and it got run again and since it was in scope.
//!
//! Prevented by using the fully-qualified test marker (`#[::core::prelude::v1::test]`).
use actix_rt::time as test;
#[actix_rt::test]
async fn test_naming_conflict() {
use test as time;
time::sleep(std::time::Duration::from_millis(2)).await;
}