macros: add build tests for #[tokio::main] and #[tokio::test] (#1591)

This commit is contained in:
Taiki Endo
2019-09-23 04:09:30 +09:00
committed by GitHub
parent ddbb0c3836
commit 3a55aba251
6 changed files with 84 additions and 2 deletions
+4
View File
@@ -37,6 +37,7 @@ fn tokio_with_net() {
// net is present
use build_tests::tokio::net;
}
#[test]
fn compile_fail() {
let t = trybuild::TestCases::new();
@@ -44,6 +45,9 @@ fn compile_fail() {
#[cfg(feature = "executor-without-current-thread")]
t.compile_fail("tests/fail/executor_without_current_thread.rs");
#[cfg(feature = "macros-invalid-input")]
t.compile_fail("tests/fail/macros_invalid_input.rs");
#[cfg(feature = "net-no-features")]
{
t.compile_fail("tests/fail/net_without_tcp_missing_tcp.rs");