mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-29 00:00:11 +02:00
tests: remove tests module from integration tests (#6540)
This commit is contained in:
+76
-77
@@ -1,81 +1,80 @@
|
|||||||
#[cfg(all(tokio_unstable, feature = "tracing"))]
|
#![cfg(all(tokio_unstable, feature = "tracing"))]
|
||||||
mod tests {
|
|
||||||
use std::rc::Rc;
|
|
||||||
use tokio::{
|
|
||||||
task::{Builder, LocalSet},
|
|
||||||
test,
|
|
||||||
};
|
|
||||||
|
|
||||||
#[test]
|
use std::rc::Rc;
|
||||||
async fn spawn_with_name() {
|
use tokio::{
|
||||||
let result = Builder::new()
|
task::{Builder, LocalSet},
|
||||||
.name("name")
|
test,
|
||||||
.spawn(async { "task executed" })
|
};
|
||||||
.unwrap()
|
|
||||||
.await;
|
|
||||||
|
|
||||||
assert_eq!(result.unwrap(), "task executed");
|
#[test]
|
||||||
}
|
async fn spawn_with_name() {
|
||||||
|
let result = Builder::new()
|
||||||
|
.name("name")
|
||||||
|
.spawn(async { "task executed" })
|
||||||
|
.unwrap()
|
||||||
|
.await;
|
||||||
|
|
||||||
#[test]
|
assert_eq!(result.unwrap(), "task executed");
|
||||||
async fn spawn_blocking_with_name() {
|
}
|
||||||
let result = Builder::new()
|
|
||||||
.name("name")
|
#[test]
|
||||||
.spawn_blocking(|| "task executed")
|
async fn spawn_blocking_with_name() {
|
||||||
.unwrap()
|
let result = Builder::new()
|
||||||
.await;
|
.name("name")
|
||||||
|
.spawn_blocking(|| "task executed")
|
||||||
assert_eq!(result.unwrap(), "task executed");
|
.unwrap()
|
||||||
}
|
.await;
|
||||||
|
|
||||||
#[test]
|
assert_eq!(result.unwrap(), "task executed");
|
||||||
async fn spawn_local_with_name() {
|
}
|
||||||
let unsend_data = Rc::new("task executed");
|
|
||||||
let result = LocalSet::new()
|
#[test]
|
||||||
.run_until(async move {
|
async fn spawn_local_with_name() {
|
||||||
Builder::new()
|
let unsend_data = Rc::new("task executed");
|
||||||
.name("name")
|
let result = LocalSet::new()
|
||||||
.spawn_local(async move { unsend_data })
|
.run_until(async move {
|
||||||
.unwrap()
|
Builder::new()
|
||||||
.await
|
.name("name")
|
||||||
})
|
.spawn_local(async move { unsend_data })
|
||||||
.await;
|
.unwrap()
|
||||||
|
.await
|
||||||
assert_eq!(*result.unwrap(), "task executed");
|
})
|
||||||
}
|
.await;
|
||||||
|
|
||||||
#[test]
|
assert_eq!(*result.unwrap(), "task executed");
|
||||||
async fn spawn_without_name() {
|
}
|
||||||
let result = Builder::new()
|
|
||||||
.spawn(async { "task executed" })
|
#[test]
|
||||||
.unwrap()
|
async fn spawn_without_name() {
|
||||||
.await;
|
let result = Builder::new()
|
||||||
|
.spawn(async { "task executed" })
|
||||||
assert_eq!(result.unwrap(), "task executed");
|
.unwrap()
|
||||||
}
|
.await;
|
||||||
|
|
||||||
#[test]
|
assert_eq!(result.unwrap(), "task executed");
|
||||||
async fn spawn_blocking_without_name() {
|
}
|
||||||
let result = Builder::new()
|
|
||||||
.spawn_blocking(|| "task executed")
|
#[test]
|
||||||
.unwrap()
|
async fn spawn_blocking_without_name() {
|
||||||
.await;
|
let result = Builder::new()
|
||||||
|
.spawn_blocking(|| "task executed")
|
||||||
assert_eq!(result.unwrap(), "task executed");
|
.unwrap()
|
||||||
}
|
.await;
|
||||||
|
|
||||||
#[test]
|
assert_eq!(result.unwrap(), "task executed");
|
||||||
async fn spawn_local_without_name() {
|
}
|
||||||
let unsend_data = Rc::new("task executed");
|
|
||||||
let result = LocalSet::new()
|
#[test]
|
||||||
.run_until(async move {
|
async fn spawn_local_without_name() {
|
||||||
Builder::new()
|
let unsend_data = Rc::new("task executed");
|
||||||
.spawn_local(async move { unsend_data })
|
let result = LocalSet::new()
|
||||||
.unwrap()
|
.run_until(async move {
|
||||||
.await
|
Builder::new()
|
||||||
})
|
.spawn_local(async move { unsend_data })
|
||||||
.await;
|
.unwrap()
|
||||||
|
.await
|
||||||
assert_eq!(*result.unwrap(), "task executed");
|
})
|
||||||
}
|
.await;
|
||||||
|
|
||||||
|
assert_eq!(*result.unwrap(), "task executed");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user