mirror of https://github.com/fafhrd91/actix-web
simplify test macro cases
This commit is contained in:
parent
b01ab1baa5
commit
cf7974ada5
|
@ -6,31 +6,15 @@ fn compile_macros() {
|
||||||
t.compile_fail("tests/trybuild/simple-fail.rs");
|
t.compile_fail("tests/trybuild/simple-fail.rs");
|
||||||
|
|
||||||
t.pass("tests/trybuild/route-ok.rs");
|
t.pass("tests/trybuild/route-ok.rs");
|
||||||
|
|
||||||
test_route_duplicate_unexpected_method(&t);
|
|
||||||
test_route_missing_method(&t)
|
|
||||||
}
|
|
||||||
|
|
||||||
#[rustversion::stable(1.46)]
|
|
||||||
fn test_route_missing_method(t: &trybuild::TestCases) {
|
|
||||||
t.compile_fail("tests/trybuild/route-missing-method-fail-msrv.rs");
|
|
||||||
}
|
|
||||||
|
|
||||||
#[rustversion::not(stable(1.46))]
|
|
||||||
#[rustversion::not(nightly)]
|
|
||||||
fn test_route_missing_method(t: &trybuild::TestCases) {
|
|
||||||
t.compile_fail("tests/trybuild/route-missing-method-fail.rs");
|
t.compile_fail("tests/trybuild/route-missing-method-fail.rs");
|
||||||
}
|
|
||||||
|
|
||||||
#[rustversion::nightly]
|
|
||||||
fn test_route_missing_method(_t: &trybuild::TestCases) {}
|
|
||||||
|
|
||||||
// FIXME: Re-test them on nightly once rust-lang/rust#77993 is fixed.
|
|
||||||
#[rustversion::not(nightly)]
|
|
||||||
fn test_route_duplicate_unexpected_method(t: &trybuild::TestCases) {
|
|
||||||
t.compile_fail("tests/trybuild/route-duplicate-method-fail.rs");
|
t.compile_fail("tests/trybuild/route-duplicate-method-fail.rs");
|
||||||
t.compile_fail("tests/trybuild/route-unexpected-method-fail.rs");
|
t.compile_fail("tests/trybuild/route-unexpected-method-fail.rs");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[rustversion::nightly]
|
// #[rustversion::not(nightly)]
|
||||||
fn test_route_duplicate_unexpected_method(_t: &trybuild::TestCases) {}
|
// fn skip_on_nightly(t: &trybuild::TestCases) {
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
|
||||||
|
// #[rustversion::nightly]
|
||||||
|
// fn skip_on_nightly(_t: &trybuild::TestCases) {}
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
route-missing-method-fail.rs
|
|
|
@ -1,11 +0,0 @@
|
||||||
error: The #[route(..)] macro requires at least one `method` attribute
|
|
||||||
--> $DIR/route-missing-method-fail-msrv.rs:3:1
|
|
||||||
|
|
|
||||||
3 | #[route("/")]
|
|
||||||
| ^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
error[E0425]: cannot find value `index` in this scope
|
|
||||||
--> $DIR/route-missing-method-fail-msrv.rs:12:49
|
|
||||||
|
|
|
||||||
12 | let srv = test::start(|| App::new().service(index));
|
|
||||||
| ^^^^^ not found in this scope
|
|
Loading…
Reference in New Issue