1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-11-26 03:21:08 +00:00
actix-web/tests/test-macro-import-conflict.rs
2021-10-19 17:30:32 +01:00

15 lines
607 B
Rust

//! 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_web::test;
#[actix_web::test]
async fn test_macro_naming_conflict() {
let _req = test::TestRequest::default();
assert_eq!(async { 1 }.await, 1);
}