mirror of
https://github.com/tokio-rs/axum.git
synced 2025-09-27 04:50:31 +00:00
axum-extra: gate rejection test behind feature (#3493)
This commit is contained in:
parent
817aae3d1e
commit
cc11b5ad7d
@ -384,10 +384,7 @@ impl_second_element_is!(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use crate::{
|
use crate::routing::{RouterExt, TypedPath};
|
||||||
extract::WithRejection,
|
|
||||||
routing::{RouterExt, TypedPath},
|
|
||||||
};
|
|
||||||
use axum::{
|
use axum::{
|
||||||
extract::rejection::PathRejection,
|
extract::rejection::PathRejection,
|
||||||
response::{IntoResponse, Response},
|
response::{IntoResponse, Response},
|
||||||
@ -441,9 +438,10 @@ mod tests {
|
|||||||
assert_eq!(uri, "/users/1?&foo=foo&bar=123&baz=true&qux=1337");
|
assert_eq!(uri, "/users/1?&foo=foo&bar=123&baz=true&qux=1337");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "with-rejection")]
|
||||||
#[allow(dead_code)] // just needs to compile
|
#[allow(dead_code)] // just needs to compile
|
||||||
fn supports_with_rejection() {
|
fn supports_with_rejection() {
|
||||||
async fn handler(_: WithRejection<UsersShow, MyRejection>) {}
|
async fn handler(_: crate::extract::WithRejection<UsersShow, MyRejection>) {}
|
||||||
|
|
||||||
struct MyRejection {}
|
struct MyRejection {}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user