Skip to content

Commit 39f457e

Browse files
committed
Reorder tests
1 parent fa363ba commit 39f457e

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

axum/src/routing/tests/mod.rs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,6 +1058,22 @@ async fn impl_handler_for_into_response() {
10581058
assert_eq!(res.text().await, "thing created");
10591059
}
10601060

1061+
#[crate::test]
1062+
#[should_panic(
1063+
expected = "Path segments must not start with `:`. For capture groups, use `{capture}`. If you meant to literally match a segment starting with a colon, call `without_v07_checks` on the router."
1064+
)]
1065+
async fn colon_in_route() {
1066+
_ = Router::<()>::new().route("/:foo", get(|| async move {}));
1067+
}
1068+
1069+
#[crate::test]
1070+
#[should_panic(
1071+
expected = "Path segments must not start with `*`. For wildcard capture, use `{*wildcard}`. If you meant to literally match a segment starting with an asterisk, call `without_v07_checks` on the router."
1072+
)]
1073+
async fn asterisk_in_route() {
1074+
_ = Router::<()>::new().route("/*foo", get(|| async move {}));
1075+
}
1076+
10611077
#[crate::test]
10621078
async fn middleware_adding_body() {
10631079
let app = Router::new()
@@ -1076,19 +1092,3 @@ async fn middleware_adding_body() {
10761092
let res = client.get("/").await;
10771093
assert_eq!(res.text().await, "…");
10781094
}
1079-
1080-
#[crate::test]
1081-
#[should_panic(
1082-
expected = "Path segments must not start with `:`. For capture groups, use `{capture}`. If you meant to literally match a segment starting with a colon, call `without_v07_checks` on the router."
1083-
)]
1084-
async fn colon_in_route() {
1085-
_ = Router::<()>::new().route("/:foo", get(|| async move {}));
1086-
}
1087-
1088-
#[crate::test]
1089-
#[should_panic(
1090-
expected = "Path segments must not start with `*`. For wildcard capture, use `{*wildcard}`. If you meant to literally match a segment starting with an asterisk, call `without_v07_checks` on the router."
1091-
)]
1092-
async fn asterisk_in_route() {
1093-
_ = Router::<()>::new().route("/*foo", get(|| async move {}));
1094-
}

0 commit comments

Comments
 (0)