From b91607bfb263d101c4a33b2b9b01b2093c1713d0 Mon Sep 17 00:00:00 2001 From: realaravinth Date: Thu, 13 May 2021 19:42:19 +0530 Subject: [PATCH] tests for multiple path failure --- actix-web-codegen/tests/trybuild/simple-fail.rs | 7 +++++++ actix-web-codegen/tests/trybuild/simple-fail.stderr | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/actix-web-codegen/tests/trybuild/simple-fail.rs b/actix-web-codegen/tests/trybuild/simple-fail.rs index a57fdc16d..73760ee13 100644 --- a/actix-web-codegen/tests/trybuild/simple-fail.rs +++ b/actix-web-codegen/tests/trybuild/simple-fail.rs @@ -27,4 +27,11 @@ async fn five() -> String { "Hello World!".to_owned() } +const SIX: &str = "/six"; + +#[get("/six", path="SIX")] +async fn six() -> String { + "Hello World!".to_owned() +} + fn main() {} diff --git a/actix-web-codegen/tests/trybuild/simple-fail.stderr b/actix-web-codegen/tests/trybuild/simple-fail.stderr index cffc81ff8..a0915288b 100644 --- a/actix-web-codegen/tests/trybuild/simple-fail.stderr +++ b/actix-web-codegen/tests/trybuild/simple-fail.stderr @@ -27,3 +27,9 @@ error: HTTP method forbidden here. To handle multiple methods, use `route` inste | 25 | #[delete("/five", method="GET")] | ^^^^^^^^^^^^ + +error: Multiple paths specified! Should be only one! + --> $DIR/simple-fail.rs:32:20 + | +32 | #[get("/six", path="SIX")] + | ^^^^^