mirror of
https://github.com/fafhrd91/actix-web
synced 2025-06-26 15:07:42 +02:00
add trybuild tests to routing codegen (#1677)
This commit is contained in:
15
actix-web-codegen/tests/trybuild/simple.rs
Normal file
15
actix-web-codegen/tests/trybuild/simple.rs
Normal file
@ -0,0 +1,15 @@
|
||||
use actix_web::*;
|
||||
|
||||
#[get("/config")]
|
||||
async fn config() -> impl Responder {
|
||||
HttpResponse::Ok()
|
||||
}
|
||||
|
||||
#[actix_web::main]
|
||||
async fn main() {
|
||||
let srv = test::start(|| App::new().service(config));
|
||||
|
||||
let request = srv.get("/config");
|
||||
let response = request.send().await.unwrap();
|
||||
assert!(response.status().is_success());
|
||||
}
|
Reference in New Issue
Block a user