Switch the async runtime used for testing to Tokio.

This commit is contained in:
Sunli 2021-03-12 12:47:24 +08:00
parent e77fc7d914
commit 4f47703118
52 changed files with 172 additions and 175 deletions

View File

@ -77,7 +77,7 @@ futures-timer = { version = "3.0.2", optional = true }
futures-channel = { version = "0.3.8", optional = true } futures-channel = { version = "0.3.8", optional = true }
[dev-dependencies] [dev-dependencies]
async-std = { version = "1.6.5", features = ["attributes"] } tokio = { version = "1.3.0", features = ["macros", "rt", "sync", "time"] }
futures-channel = "0.3.8" futures-channel = "0.3.8"
[package.metadata.docs.rs] [package.metadata.docs.rs]

View File

@ -650,7 +650,7 @@ impl<'a> ContextBase<'a, &'a Positioned<Field>> {
/// } /// }
/// } /// }
/// ///
/// async_std::task::block_on(async move { /// tokio::runtime::Runtime::new().unwrap().block_on(async move {
/// let schema = Schema::new(Query, EmptyMutation, EmptySubscription); /// let schema = Schema::new(Query, EmptyMutation, EmptySubscription);
/// assert!(schema.execute("{ obj { a b c }}").await.is_ok()); /// assert!(schema.execute("{ obj { a b c }}").await.is_ok());
/// assert!(schema.execute("{ obj { a ... { b c } }}").await.is_ok()); /// assert!(schema.execute("{ obj { a ... { b c } }}").await.is_ok());

View File

@ -32,7 +32,7 @@
//! } //! }
//! } //! }
//! //!
//! async_std::task::block_on(async move { //! tokio::runtime::Runtime::new().unwrap().block_on(async move {
//! let schema = Schema::new(Query, EmptyMutation, EmptySubscription); //! let schema = Schema::new(Query, EmptyMutation, EmptySubscription);
//! let query = r#" //! let query = r#"
//! { //! {
@ -249,7 +249,7 @@ mod tests {
} }
} }
#[async_std::test] #[tokio::test]
async fn test_dataloader() { async fn test_dataloader() {
let loader = Arc::new(DataLoader::new(MyLoader).max_batch_size(10)); let loader = Arc::new(DataLoader::new(MyLoader).max_batch_size(10));
assert_eq!( assert_eq!(
@ -279,7 +279,7 @@ mod tests {
); );
} }
#[async_std::test] #[tokio::test]
async fn test_duplicate_keys() { async fn test_duplicate_keys() {
let loader = Arc::new(DataLoader::new(MyLoader).max_batch_size(10)); let loader = Arc::new(DataLoader::new(MyLoader).max_batch_size(10));
assert_eq!( assert_eq!(

View File

@ -72,7 +72,7 @@ mod tests {
} }
} }
#[async_std::test] #[tokio::test]
async fn analyzer() { async fn analyzer() {
let schema = Schema::build(Query, EmptyMutation, EmptySubscription) let schema = Schema::build(Query, EmptyMutation, EmptySubscription)
.extension(extensions::Analyzer) .extension(extensions::Analyzer)

View File

@ -116,7 +116,7 @@ impl<T: CacheStorage> Extension for ApolloPersistedQueriesExtension<T> {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
#[async_std::test] #[tokio::test]
async fn test() { async fn test() {
use super::*; use super::*;
use crate::*; use crate::*;

View File

@ -50,7 +50,7 @@ impl TracingConfig {
/// "span root" /// "span root"
/// ); /// );
/// ///
/// async_std::task::block_on(async move { /// tokio::runtime::Runtime::new().unwrap().block_on(async move {
/// let request = Request::new("{ value }") /// let request = Request::new("{ value }")
/// .data(TracingConfig::default().parent_span(root_span)); /// .data(TracingConfig::default().parent_span(root_span));
/// schema.execute(request).await; /// schema.execute(request).await;

View File

@ -348,7 +348,7 @@ pub type FieldResult<T> = Result<T>;
/// } /// }
/// } /// }
/// ///
/// async_std::task::block_on(async move { /// tokio::runtime::Runtime::new().unwrap().block_on(async move {
/// let schema = Schema::new(QueryRoot { value: 10 }, EmptyMutation, EmptySubscription); /// let schema = Schema::new(QueryRoot { value: 10 }, EmptyMutation, EmptySubscription);
/// let res = schema.execute(r#"{ /// let res = schema.execute(r#"{
/// value /// value
@ -406,7 +406,7 @@ pub type FieldResult<T> = Result<T>;
/// } /// }
/// } /// }
/// ///
/// async_std::task::block_on(async move { /// tokio::runtime::Runtime::new().unwrap().block_on(async move {
/// let schema = Schema::new(QueryRoot, EmptyMutation, EmptySubscription); /// let schema = Schema::new(QueryRoot, EmptyMutation, EmptySubscription);
/// let res = schema.execute("{ objs { name } }").await.into_result().unwrap().data; /// let res = schema.execute("{ objs { name } }").await.into_result().unwrap().data;
/// assert_eq!(res, value!({ /// assert_eq!(res, value!({
@ -463,7 +463,7 @@ pub use async_graphql_derive::Object;
/// value: i32, /// value: i32,
/// } /// }
/// ///
/// async_std::task::block_on(async move { /// tokio::runtime::Runtime::new().unwrap().block_on(async move {
/// let schema = Schema::new(QueryRoot{ value: 10 }, EmptyMutation, EmptySubscription); /// let schema = Schema::new(QueryRoot{ value: 10 }, EmptyMutation, EmptySubscription);
/// let res = schema.execute("{ value }").await.into_result().unwrap().data; /// let res = schema.execute("{ value }").await.into_result().unwrap().data;
/// assert_eq!(res, value!({ /// assert_eq!(res, value!({
@ -526,7 +526,7 @@ pub use async_graphql_derive::SimpleObject;
/// } /// }
/// } /// }
/// ///
/// async_std::task::block_on(async move { /// tokio::runtime::Runtime::new().unwrap().block_on(async move {
/// let schema = Schema::new(QueryRoot{ value1: MyEnum::A, value2: MyEnum::B }, EmptyMutation, EmptySubscription); /// let schema = Schema::new(QueryRoot{ value1: MyEnum::A, value2: MyEnum::B }, EmptyMutation, EmptySubscription);
/// let res = schema.execute("{ value1 value2 }").await.into_result().unwrap().data; /// let res = schema.execute("{ value1 value2 }").await.into_result().unwrap().data;
/// assert_eq!(res, value!({ "value1": "A", "value2": "b" })); /// assert_eq!(res, value!({ "value1": "A", "value2": "b" }));
@ -583,7 +583,7 @@ pub use async_graphql_derive::Enum;
/// } /// }
/// } /// }
/// ///
/// async_std::task::block_on(async move { /// tokio::runtime::Runtime::new().unwrap().block_on(async move {
/// let schema = Schema::new(QueryRoot, EmptyMutation, EmptySubscription); /// let schema = Schema::new(QueryRoot, EmptyMutation, EmptySubscription);
/// let res = schema.execute(r#" /// let res = schema.execute(r#"
/// { /// {
@ -713,7 +713,7 @@ pub use async_graphql_derive::InputObject;
/// } /// }
/// } /// }
/// ///
/// async_std::task::block_on(async move { /// tokio::runtime::Runtime::new().unwrap().block_on(async move {
/// let schema = Schema::build(QueryRoot, EmptyMutation, EmptySubscription).data("hello".to_string()).finish(); /// let schema = Schema::build(QueryRoot, EmptyMutation, EmptySubscription).data("hello".to_string()).finish();
/// let res = schema.execute(r#" /// let res = schema.execute(r#"
/// { /// {
@ -786,7 +786,7 @@ pub use async_graphql_derive::Interface;
/// } /// }
/// } /// }
/// ///
/// async_std::task::block_on(async move { /// tokio::runtime::Runtime::new().unwrap().block_on(async move {
/// let schema = Schema::build(QueryRoot, EmptyMutation, EmptySubscription).data("hello".to_string()).finish(); /// let schema = Schema::build(QueryRoot, EmptyMutation, EmptySubscription).data("hello".to_string()).finish();
/// let res = schema.execute(r#" /// let res = schema.execute(r#"
/// { /// {
@ -899,7 +899,7 @@ pub use async_graphql_derive::Scalar;
/// } /// }
/// } /// }
/// ///
/// async_std::task::block_on(async move { /// tokio::runtime::Runtime::new().unwrap().block_on(async move {
/// let schema = Schema::build(QueryRoot, EmptyMutation, EmptySubscription).data("hello".to_string()).finish(); /// let schema = Schema::build(QueryRoot, EmptyMutation, EmptySubscription).data("hello".to_string()).finish();
/// ///
/// let res = schema.execute("{ value }").await.into_result().unwrap().data; /// let res = schema.execute("{ value }").await.into_result().unwrap().data;
@ -1047,7 +1047,7 @@ pub use async_graphql_derive::MergedSubscription;
/// obj: MyObj, /// obj: MyObj,
/// } /// }
/// ///
/// async_std::task::block_on(async move { /// tokio::runtime::Runtime::new().unwrap().block_on(async move {
/// let schema = Schema::new(Query::default(), EmptyMutation, EmptySubscription); /// let schema = Schema::new(Query::default(), EmptyMutation, EmptySubscription);
/// assert_eq!( /// assert_eq!(
/// schema /// schema

View File

@ -70,7 +70,7 @@ fn find<'a>(
mod tests { mod tests {
use crate::*; use crate::*;
#[async_std::test] #[tokio::test]
async fn test_look_ahead() { async fn test_look_ahead() {
#[derive(SimpleObject)] #[derive(SimpleObject)]
#[graphql(internal)] #[graphql(internal)]

View File

@ -20,13 +20,12 @@
/// } /// }
/// } /// }
/// ///
/// #[async_std::main] /// tokio::runtime::Runtime::new().unwrap().block_on(async {
/// async fn main() {
/// let schema = Schema::new(QueryRoot, EmptyMutation, EmptySubscription); /// let schema = Schema::new(QueryRoot, EmptyMutation, EmptySubscription);
/// assert_eq!(schema.execute("{ value1 }").await.into_result().unwrap().cache_control, CacheControl { public: true, max_age: 30 }); /// assert_eq!(schema.execute("{ value1 }").await.into_result().unwrap().cache_control, CacheControl { public: true, max_age: 30 });
/// assert_eq!(schema.execute("{ value2 }").await.into_result().unwrap().cache_control, CacheControl { public: false, max_age: 60 }); /// assert_eq!(schema.execute("{ value2 }").await.into_result().unwrap().cache_control, CacheControl { public: false, max_age: 60 });
/// assert_eq!(schema.execute("{ value1 value2 }").await.into_result().unwrap().cache_control, CacheControl { public: false, max_age: 30 }); /// assert_eq!(schema.execute("{ value1 value2 }").await.into_result().unwrap().cache_control, CacheControl { public: false, max_age: 30 });
/// } /// });
/// ``` /// ```
#[derive(Clone, Copy, PartialEq, Eq, Debug)] #[derive(Clone, Copy, PartialEq, Eq, Debug)]
pub struct CacheControl { pub struct CacheControl {

View File

@ -77,7 +77,7 @@ pub trait ScalarType: Sized + Send {
/// } /// }
/// } /// }
/// ///
/// async_std::task::block_on(async move { /// tokio::runtime::Runtime::new().unwrap().block_on(async move {
/// let schema = Schema::new(Query, EmptyMutation, EmptySubscription); /// let schema = Schema::new(Query, EmptyMutation, EmptySubscription);
/// let res = schema.execute(r#"{ value(input: {a: 10, b: {v1: 1, v2: 2} }) }"#).await.into_result().unwrap().data; /// let res = schema.execute(r#"{ value(input: {a: 10, b: {v1: 1, v2: 2} }) }"#).await.into_result().unwrap().data;
/// assert_eq!(res, value!({ /// assert_eq!(res, value!({

View File

@ -67,8 +67,7 @@ pub struct EmptyFields;
/// } /// }
/// } /// }
/// ///
/// #[async_std::main] /// tokio::runtime::Runtime::new().unwrap().block_on(async {
/// async fn main() {
/// let schema = Schema::new(QueryRoot, EmptyMutation, EmptySubscription); /// let schema = Schema::new(QueryRoot, EmptyMutation, EmptySubscription);
/// ///
/// assert_eq!(schema.execute("{ numbers(first: 2) { edges { node diff } } }").await.into_result().unwrap().data, value!({ /// assert_eq!(schema.execute("{ numbers(first: 2) { edges { node diff } } }").await.into_result().unwrap().data, value!({
@ -88,7 +87,7 @@ pub struct EmptyFields;
/// ] /// ]
/// }, /// },
/// })); /// }));
/// } /// });
/// ``` /// ```
pub async fn query<Cursor, Node, ConnectionFields, EdgeFields, F, R>( pub async fn query<Cursor, Node, ConnectionFields, EdgeFields, F, R>(
after: Option<String>, after: Option<String>,

View File

@ -36,7 +36,7 @@ mod test {
use crate::*; use crate::*;
use std::borrow::Cow; use std::borrow::Cow;
#[async_std::test] #[tokio::test]
async fn test_cow_type() { async fn test_cow_type() {
struct Query { struct Query {
obj: MyObj, obj: MyObj,

View File

@ -106,7 +106,7 @@ mod test {
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::collections::HashMap; use std::collections::HashMap;
#[async_std::test] #[tokio::test]
async fn test_json_type() { async fn test_json_type() {
#[derive(Serialize, Deserialize)] #[derive(Serialize, Deserialize)]
struct MyStruct { struct MyStruct {
@ -138,7 +138,7 @@ mod test {
); );
} }
#[async_std::test] #[tokio::test]
async fn test_output_json_type() { async fn test_output_json_type() {
#[derive(Serialize)] #[derive(Serialize)]
struct MyStruct { struct MyStruct {

View File

@ -28,8 +28,7 @@ use crate::{registry, InputType, InputValueError, InputValueResult, Type, Value}
/// } /// }
/// } /// }
/// ///
/// #[async_std::main] /// tokio::runtime::Runtime::new().unwrap().block_on(async {
/// async fn main() {
/// let schema = Schema::new(Query, EmptyMutation, EmptySubscription); /// let schema = Schema::new(Query, EmptyMutation, EmptySubscription);
/// let query = r#" /// let query = r#"
/// { /// {
@ -45,7 +44,7 @@ use crate::{registry, InputType, InputValueError, InputValueResult, Type, Value}
/// "v3": 2, /// "v3": 2,
/// }) /// })
/// ); /// );
/// } /// });
/// ``` /// ```
#[allow(missing_docs)] #[allow(missing_docs)]
#[derive(Copy, Clone, PartialEq, PartialOrd, Eq, Ord, Debug, Hash)] #[derive(Copy, Clone, PartialEq, PartialOrd, Eq, Ord, Debug, Hash)]

View File

@ -40,7 +40,7 @@ where
mod test { mod test {
use crate::*; use crate::*;
#[async_std::test] #[tokio::test]
async fn test_string_number() { async fn test_string_number() {
struct Query; struct Query;

View File

@ -1,6 +1,6 @@
use async_graphql::*; use async_graphql::*;
#[async_std::test] #[tokio::test]
pub async fn test_batch_request() { pub async fn test_batch_request() {
struct Query; struct Query;

View File

@ -1,7 +1,7 @@
use async_graphql::connection::*; use async_graphql::connection::*;
use async_graphql::*; use async_graphql::*;
#[async_std::test] #[tokio::test]
pub async fn test_connection_additional_fields() { pub async fn test_connection_additional_fields() {
struct QueryRoot; struct QueryRoot;

View File

@ -1,6 +1,6 @@
use async_graphql::*; use async_graphql::*;
#[async_std::test] #[tokio::test]
pub async fn test_default_value_arg() { pub async fn test_default_value_arg() {
struct Query; struct Query;
@ -47,7 +47,7 @@ pub async fn test_default_value_arg() {
); );
} }
#[async_std::test] #[tokio::test]
pub async fn test_default_value_inputobject() { pub async fn test_default_value_inputobject() {
#[derive(InputObject)] #[derive(InputObject)]
struct MyInput { struct MyInput {

View File

@ -1,6 +1,6 @@
use async_graphql::*; use async_graphql::*;
#[async_std::test] #[tokio::test]
pub async fn test_directive_skip() { pub async fn test_directive_skip() {
struct QueryRoot; struct QueryRoot;
@ -30,7 +30,7 @@ pub async fn test_directive_skip() {
); );
} }
#[async_std::test] #[tokio::test]
pub async fn test_directive_include() { pub async fn test_directive_include() {
struct QueryRoot; struct QueryRoot;
@ -60,7 +60,7 @@ pub async fn test_directive_include() {
); );
} }
#[async_std::test] #[tokio::test]
pub async fn test_directive_ifdef() { pub async fn test_directive_ifdef() {
struct QueryRoot; struct QueryRoot;

View File

@ -1,6 +1,6 @@
use async_graphql::*; use async_graphql::*;
#[async_std::test] #[tokio::test]
pub async fn test_enum_type() { pub async fn test_enum_type() {
#[derive(Enum, Copy, Clone, Eq, PartialEq)] #[derive(Enum, Copy, Clone, Eq, PartialEq)]
enum MyEnum { enum MyEnum {
@ -49,7 +49,7 @@ pub async fn test_enum_type() {
); );
} }
#[async_std::test] #[tokio::test]
pub async fn test_enum_derive_and_item_attributes() { pub async fn test_enum_derive_and_item_attributes() {
use serde::Deserialize; use serde::Deserialize;
@ -71,7 +71,7 @@ pub async fn test_enum_derive_and_item_attributes() {
); );
} }
#[async_std::test] #[tokio::test]
pub async fn test_remote_enum() { pub async fn test_remote_enum() {
#[derive(Enum, Copy, Clone, Eq, PartialEq)] #[derive(Enum, Copy, Clone, Eq, PartialEq)]
#[graphql(remote = "remote::RemoteEnum")] #[graphql(remote = "remote::RemoteEnum")]

View File

@ -1,6 +1,6 @@
use async_graphql::*; use async_graphql::*;
#[async_std::test] #[tokio::test]
pub async fn test_error_extensions() { pub async fn test_error_extensions() {
struct Query; struct Query;

View File

@ -3,7 +3,7 @@ use async_graphql::*;
use spin::Mutex; use spin::Mutex;
use std::sync::Arc; use std::sync::Arc;
#[async_std::test] #[tokio::test]
pub async fn test_extension_ctx() { pub async fn test_extension_ctx() {
#[derive(Default, Clone)] #[derive(Default, Clone)]
struct MyData(Arc<Mutex<i32>>); struct MyData(Arc<Mutex<i32>>);

View File

@ -6,7 +6,7 @@ use std::convert::Infallible;
use async_graphql::dataloader::{DataLoader, Loader}; use async_graphql::dataloader::{DataLoader, Loader};
use async_graphql::*; use async_graphql::*;
#[async_std::test] #[tokio::test]
pub async fn test_nested_key() { pub async fn test_nested_key() {
#[derive(InputObject)] #[derive(InputObject)]
struct MyInputA { struct MyInputA {
@ -66,7 +66,7 @@ pub async fn test_nested_key() {
); );
} }
#[async_std::test] #[tokio::test]
pub async fn test_federation() { pub async fn test_federation() {
struct User { struct User {
id: ID, id: ID,
@ -151,7 +151,7 @@ pub async fn test_federation() {
); );
} }
#[async_std::test] #[tokio::test]
pub async fn test_find_entity_with_context() { pub async fn test_find_entity_with_context() {
struct MyLoader; struct MyLoader;

View File

@ -3,7 +3,7 @@
use async_graphql::*; use async_graphql::*;
use futures_util::stream::{Stream, StreamExt}; use futures_util::stream::{Stream, StreamExt};
#[async_std::test] #[tokio::test]
pub async fn test_field_features() { pub async fn test_field_features() {
#[derive(SimpleObject)] #[derive(SimpleObject)]
struct MyObj { struct MyObj {

View File

@ -1,6 +1,6 @@
use async_graphql::*; use async_graphql::*;
#[async_std::test] #[tokio::test]
pub async fn test_field_merge() { pub async fn test_field_merge() {
struct Query; struct Query;
@ -41,7 +41,7 @@ pub async fn test_field_merge() {
); );
} }
#[async_std::test] #[tokio::test]
pub async fn test_field_object_merge() { pub async fn test_field_object_merge() {
#[derive(SimpleObject)] #[derive(SimpleObject)]
struct MyObject { struct MyObject {
@ -83,7 +83,7 @@ pub async fn test_field_object_merge() {
); );
} }
#[async_std::test] #[tokio::test]
pub async fn test_field_object_merge2() { pub async fn test_field_object_merge2() {
#[derive(SimpleObject)] #[derive(SimpleObject)]
struct MyObject { struct MyObject {

View File

@ -1,7 +1,7 @@
use async_graphql::*; use async_graphql::*;
use futures_util::stream::{Stream, StreamExt}; use futures_util::stream::{Stream, StreamExt};
#[async_std::test] #[tokio::test]
pub async fn test_generic_object() { pub async fn test_generic_object() {
struct MyObj<T> { struct MyObj<T> {
value: T, value: T,
@ -49,7 +49,7 @@ pub async fn test_generic_object() {
); );
} }
#[async_std::test] #[tokio::test]
pub async fn test_input_object_generic() { pub async fn test_input_object_generic() {
#[derive(InputObject)] #[derive(InputObject)]
#[graphql( #[graphql(
@ -148,7 +148,7 @@ pub async fn test_input_object_generic() {
); );
} }
#[async_std::test] #[tokio::test]
pub async fn test_generic_simple_object() { pub async fn test_generic_simple_object() {
#[derive(SimpleObject)] #[derive(SimpleObject)]
#[graphql(concrete(name = "MyObjIntString", params(i32, String)))] #[graphql(concrete(name = "MyObjIntString", params(i32, String)))]
@ -251,7 +251,7 @@ pub async fn test_generic_simple_object() {
); );
} }
#[async_std::test] #[tokio::test]
pub async fn test_generic_subscription() { pub async fn test_generic_subscription() {
struct MySubscription<T> { struct MySubscription<T> {
values: Vec<T>, values: Vec<T>,

View File

@ -57,7 +57,7 @@ impl Guard for AgeGuard {
} }
} }
#[async_std::test] #[tokio::test]
pub async fn test_guard_simple_rule() { pub async fn test_guard_simple_rule() {
#[derive(SimpleObject)] #[derive(SimpleObject)]
struct Query { struct Query {
@ -134,7 +134,7 @@ pub async fn test_guard_simple_rule() {
); );
} }
#[async_std::test] #[tokio::test]
pub async fn test_guard_and_operator() { pub async fn test_guard_and_operator() {
#[derive(SimpleObject)] #[derive(SimpleObject)]
struct Query { struct Query {
@ -218,7 +218,7 @@ pub async fn test_guard_and_operator() {
); );
} }
#[async_std::test] #[tokio::test]
pub async fn test_guard_or_operator() { pub async fn test_guard_or_operator() {
#[derive(SimpleObject)] #[derive(SimpleObject)]
struct Query { struct Query {
@ -287,7 +287,7 @@ pub async fn test_guard_or_operator() {
); );
} }
#[async_std::test] #[tokio::test]
pub async fn test_guard_chain_operator() { pub async fn test_guard_chain_operator() {
#[derive(SimpleObject)] #[derive(SimpleObject)]
struct Query { struct Query {
@ -396,7 +396,7 @@ pub async fn test_guard_chain_operator() {
); );
} }
#[async_std::test] #[tokio::test]
pub async fn test_guard_race_operator() { pub async fn test_guard_race_operator() {
#[derive(SimpleObject)] #[derive(SimpleObject)]
struct Query { struct Query {

View File

@ -1,6 +1,6 @@
use async_graphql::*; use async_graphql::*;
#[async_std::test] #[tokio::test]
pub async fn test_input_object_default_value() { pub async fn test_input_object_default_value() {
#[derive(InputObject)] #[derive(InputObject)]
struct MyInput { struct MyInput {
@ -87,7 +87,7 @@ pub async fn test_input_object_default_value() {
); );
} }
#[async_std::test] #[tokio::test]
pub async fn test_inputobject_derive_and_item_attributes() { pub async fn test_inputobject_derive_and_item_attributes() {
use serde::Deserialize; use serde::Deserialize;
@ -103,7 +103,7 @@ pub async fn test_inputobject_derive_and_item_attributes() {
); );
} }
#[async_std::test] #[tokio::test]
pub async fn test_inputobject_flatten_recursive() { pub async fn test_inputobject_flatten_recursive() {
#[derive(InputObject, Debug, Eq, PartialEq)] #[derive(InputObject, Debug, Eq, PartialEq)]
struct A { struct A {
@ -230,7 +230,7 @@ pub async fn test_inputobject_flatten_recursive() {
); );
} }
#[async_std::test] #[tokio::test]
pub async fn test_inputobject_flatten_multiple() { pub async fn test_inputobject_flatten_multiple() {
#[derive(InputObject, Debug, Eq, PartialEq)] #[derive(InputObject, Debug, Eq, PartialEq)]
struct A { struct A {
@ -288,7 +288,7 @@ pub async fn test_inputobject_flatten_multiple() {
); );
} }
#[async_std::test] #[tokio::test]
pub async fn test_input_object_skip_field() { pub async fn test_input_object_skip_field() {
#[derive(InputObject)] #[derive(InputObject)]
struct MyInput2 { struct MyInput2 {
@ -319,7 +319,7 @@ pub async fn test_input_object_skip_field() {
); );
} }
#[async_std::test] #[tokio::test]
pub async fn test_box_input_object() { pub async fn test_box_input_object() {
#[derive(InputObject)] #[derive(InputObject)]
struct MyInput { struct MyInput {

View File

@ -4,7 +4,7 @@ use async_graphql::validators::{
}; };
use async_graphql::*; use async_graphql::*;
#[async_std::test] #[tokio::test]
pub async fn test_input_validator_string_min_length() { pub async fn test_input_validator_string_min_length() {
struct QueryRoot; struct QueryRoot;
@ -120,7 +120,7 @@ pub async fn test_input_validator_string_min_length() {
} }
} }
#[async_std::test] #[tokio::test]
pub async fn test_input_validator_string_max_length() { pub async fn test_input_validator_string_max_length() {
struct QueryRoot; struct QueryRoot;
@ -230,7 +230,7 @@ pub async fn test_input_validator_string_max_length() {
} }
} }
#[async_std::test] #[tokio::test]
pub async fn test_input_validator_string_email() { pub async fn test_input_validator_string_email() {
struct QueryRoot; struct QueryRoot;
@ -370,7 +370,7 @@ pub async fn test_input_validator_string_email() {
} }
} }
#[async_std::test] #[tokio::test]
pub async fn test_input_validator_string_mac() { pub async fn test_input_validator_string_mac() {
struct QueryRootWithColon; struct QueryRootWithColon;
struct QueryRootWithoutColon; struct QueryRootWithoutColon;
@ -660,7 +660,7 @@ pub async fn test_input_validator_string_mac() {
} }
} }
#[async_std::test] #[tokio::test]
pub async fn test_input_validator_int_range() { pub async fn test_input_validator_int_range() {
struct QueryRoot; struct QueryRoot;
@ -762,7 +762,7 @@ pub async fn test_input_validator_int_range() {
} }
} }
#[async_std::test] #[tokio::test]
pub async fn test_input_validator_int_less_than() { pub async fn test_input_validator_int_less_than() {
struct QueryRoot; struct QueryRoot;
@ -867,7 +867,7 @@ pub async fn test_input_validator_int_less_than() {
} }
} }
#[async_std::test] #[tokio::test]
pub async fn test_input_validator_int_greater_than() { pub async fn test_input_validator_int_greater_than() {
struct QueryRoot; struct QueryRoot;
@ -974,7 +974,7 @@ pub async fn test_input_validator_int_greater_than() {
} }
} }
#[async_std::test] #[tokio::test]
pub async fn test_input_validator_int_nonzero() { pub async fn test_input_validator_int_nonzero() {
struct QueryRoot; struct QueryRoot;
@ -1074,7 +1074,7 @@ pub async fn test_input_validator_int_nonzero() {
} }
} }
#[async_std::test] #[tokio::test]
pub async fn test_input_validator_int_equal() { pub async fn test_input_validator_int_equal() {
struct QueryRoot; struct QueryRoot;
@ -1178,7 +1178,7 @@ pub async fn test_input_validator_int_equal() {
} }
} }
#[async_std::test] #[tokio::test]
pub async fn test_input_validator_list_max_length() { pub async fn test_input_validator_list_max_length() {
struct QueryRoot; struct QueryRoot;
@ -1294,7 +1294,7 @@ pub async fn test_input_validator_list_max_length() {
} }
} }
#[async_std::test] #[tokio::test]
pub async fn test_input_validator_list_min_length() { pub async fn test_input_validator_list_min_length() {
struct QueryRoot; struct QueryRoot;
@ -1410,7 +1410,7 @@ pub async fn test_input_validator_list_min_length() {
} }
} }
#[async_std::test] #[tokio::test]
pub async fn test_input_validator_operator_or() { pub async fn test_input_validator_operator_or() {
struct QueryRoot; struct QueryRoot;
@ -1534,7 +1534,7 @@ pub async fn test_input_validator_operator_or() {
} }
} }
#[async_std::test] #[tokio::test]
pub async fn test_input_validator_operator_and() { pub async fn test_input_validator_operator_and() {
struct QueryRoot; struct QueryRoot;
@ -1651,7 +1651,7 @@ pub async fn test_input_validator_operator_and() {
} }
} }
#[async_std::test] #[tokio::test]
pub async fn test_input_validator_variable() { pub async fn test_input_validator_variable() {
struct QueryRoot; struct QueryRoot;

View File

@ -1,6 +1,6 @@
use async_graphql::*; use async_graphql::*;
#[async_std::test] #[tokio::test]
pub async fn test_input_value_custom_error() { pub async fn test_input_value_custom_error() {
struct Query; struct Query;

View File

@ -1,6 +1,6 @@
use async_graphql::*; use async_graphql::*;
#[async_std::test] #[tokio::test]
pub async fn test_interface_simple_object() { pub async fn test_interface_simple_object() {
#[derive(SimpleObject)] #[derive(SimpleObject)]
struct MyObj { struct MyObj {
@ -45,7 +45,7 @@ pub async fn test_interface_simple_object() {
); );
} }
#[async_std::test] #[tokio::test]
pub async fn test_interface_simple_object2() { pub async fn test_interface_simple_object2() {
#[derive(SimpleObject)] #[derive(SimpleObject)]
struct MyObj { struct MyObj {
@ -90,7 +90,7 @@ pub async fn test_interface_simple_object2() {
); );
} }
#[async_std::test] #[tokio::test]
pub async fn test_multiple_interfaces() { pub async fn test_multiple_interfaces() {
struct MyObj; struct MyObj;
@ -158,7 +158,7 @@ pub async fn test_multiple_interfaces() {
); );
} }
#[async_std::test] #[tokio::test]
pub async fn test_multiple_objects_in_multiple_interfaces() { pub async fn test_multiple_objects_in_multiple_interfaces() {
struct MyObjOne; struct MyObjOne;
@ -238,7 +238,7 @@ pub async fn test_multiple_objects_in_multiple_interfaces() {
); );
} }
#[async_std::test] #[tokio::test]
pub async fn test_interface_field_result() { pub async fn test_interface_field_result() {
struct MyObj; struct MyObj;
@ -282,7 +282,7 @@ pub async fn test_interface_field_result() {
); );
} }
#[async_std::test] #[tokio::test]
pub async fn test_interface_field_method() { pub async fn test_interface_field_method() {
struct A; struct A;
@ -332,7 +332,7 @@ pub async fn test_interface_field_method() {
); );
} }
#[async_std::test] #[tokio::test]
pub async fn test_interface_implement_other_interface() { pub async fn test_interface_implement_other_interface() {
#[derive(Interface)] #[derive(Interface)]
#[graphql(field(name = "id", type = "ID"))] #[graphql(field(name = "id", type = "ID"))]
@ -398,7 +398,7 @@ pub async fn test_interface_implement_other_interface() {
); );
} }
#[async_std::test] #[tokio::test]
pub async fn test_issue_330() { pub async fn test_issue_330() {
#[derive(Interface)] #[derive(Interface)]
#[graphql(field( #[graphql(field(

View File

@ -1,5 +1,5 @@
use async_graphql::*; use async_graphql::*;
use async_std::stream::{self, Stream}; use futures_util::stream::{self, Stream};
#[derive(Clone, Debug)] #[derive(Clone, Debug)]
struct Circle { struct Circle {
@ -171,11 +171,11 @@ impl Subscription {
&self, &self,
#[graphql(default = 1)] step: i32, #[graphql(default = 1)] step: i32,
) -> impl Stream<Item = i32> { ) -> impl Stream<Item = i32> {
stream::once(step) stream::once(async move { step })
} }
} }
// #[async_std::test] // #[tokio::test]
// pub async fn test_introspection_schema() { // pub async fn test_introspection_schema() {
// let schema = Schema::new(Query, Mutation, Subscription); // let schema = Schema::new(Query, Mutation, Subscription);
@ -219,7 +219,7 @@ impl Subscription {
// assert_eq!(res, res_json) // assert_eq!(res, res_json)
// } // }
// #[async_std::test] // #[tokio::test]
// pub async fn test_introspection_documentation() { // pub async fn test_introspection_documentation() {
// let schema = Schema::new(Query, EmptyMutation, EmptySubscription); // let schema = Schema::new(Query, EmptyMutation, EmptySubscription);
// //
@ -286,7 +286,7 @@ impl Subscription {
// assert_eq!(res, res_json) // assert_eq!(res, res_json)
// } // }
#[async_std::test] #[tokio::test]
pub async fn test_introspection_deprecation() { pub async fn test_introspection_deprecation() {
let schema = Schema::new(Query, EmptyMutation, EmptySubscription); let schema = Schema::new(Query, EmptyMutation, EmptySubscription);
@ -543,7 +543,7 @@ pub async fn test_introspection_deprecation() {
assert_eq!(res, res_json); assert_eq!(res, res_json);
} }
#[async_std::test] #[tokio::test]
pub async fn test_introspection_type_kind() { pub async fn test_introspection_type_kind() {
let schema = Schema::new(Query, Mutation, EmptySubscription); let schema = Schema::new(Query, Mutation, EmptySubscription);
@ -702,7 +702,7 @@ pub async fn test_introspection_type_kind() {
assert_eq!(res, res_json); assert_eq!(res, res_json);
} }
#[async_std::test] #[tokio::test]
pub async fn test_introspection_scalar() { pub async fn test_introspection_scalar() {
let schema = Schema::new(Query, Mutation, EmptySubscription); let schema = Schema::new(Query, Mutation, EmptySubscription);
@ -729,7 +729,7 @@ pub async fn test_introspection_scalar() {
assert_eq!(res, res_json) assert_eq!(res, res_json)
} }
#[async_std::test] #[tokio::test]
pub async fn test_introspection_union() { pub async fn test_introspection_union() {
let schema = Schema::new(Query, Mutation, EmptySubscription); let schema = Schema::new(Query, Mutation, EmptySubscription);
@ -765,7 +765,7 @@ pub async fn test_introspection_union() {
assert_eq!(res, res_json) assert_eq!(res, res_json)
} }
#[async_std::test] #[tokio::test]
pub async fn test_introspection_interface() { pub async fn test_introspection_interface() {
let schema = Schema::new(Query, EmptyMutation, EmptySubscription); let schema = Schema::new(Query, EmptyMutation, EmptySubscription);
@ -843,7 +843,7 @@ pub async fn test_introspection_interface() {
assert_eq!(res, res_json); assert_eq!(res, res_json);
} }
#[async_std::test] #[tokio::test]
pub async fn test_introspection_enum() { pub async fn test_introspection_enum() {
let schema = Schema::new(Query, Mutation, EmptySubscription); let schema = Schema::new(Query, Mutation, EmptySubscription);
@ -892,7 +892,7 @@ pub async fn test_introspection_enum() {
assert_eq!(res, res_json) assert_eq!(res, res_json)
} }
#[async_std::test] #[tokio::test]
pub async fn test_introspection_input_object() { pub async fn test_introspection_input_object() {
let schema = Schema::new(Query, Mutation, EmptySubscription); let schema = Schema::new(Query, Mutation, EmptySubscription);
@ -925,7 +925,7 @@ pub async fn test_introspection_input_object() {
assert_eq!(res, res_json) assert_eq!(res, res_json)
} }
#[async_std::test] #[tokio::test]
pub async fn test_introspection_mutation() { pub async fn test_introspection_mutation() {
let schema = Schema::new(Query, Mutation, EmptySubscription); let schema = Schema::new(Query, Mutation, EmptySubscription);
@ -973,7 +973,7 @@ pub async fn test_introspection_mutation() {
assert_eq!(res, res_json) assert_eq!(res, res_json)
} }
#[async_std::test] #[tokio::test]
pub async fn test_introspection_subscription() { pub async fn test_introspection_subscription() {
let schema = Schema::new(Query, EmptyMutation, Subscription); let schema = Schema::new(Query, EmptyMutation, Subscription);
@ -1021,7 +1021,7 @@ pub async fn test_introspection_subscription() {
assert_eq!(res, res_json) assert_eq!(res, res_json)
} }
// #[async_std::test] // #[tokio::test]
// pub async fn test_introspection_full() { // pub async fn test_introspection_full() {
// let schema = Schema::new(Query, EmptyMutation, Subscription); // let schema = Schema::new(Query, EmptyMutation, Subscription);
// //

View File

@ -1,7 +1,7 @@
use async_graphql::*; use async_graphql::*;
use serde::Deserialize; use serde::Deserialize;
#[async_std::test] #[tokio::test]
pub async fn test_type_visible() { pub async fn test_type_visible() {
#[derive(SimpleObject)] #[derive(SimpleObject)]
#[graphql(visible = false)] #[graphql(visible = false)]
@ -67,7 +67,7 @@ pub async fn test_type_visible() {
.is_none()); .is_none());
} }
#[async_std::test] #[tokio::test]
pub async fn test_field_visible() { pub async fn test_field_visible() {
#[derive(SimpleObject)] #[derive(SimpleObject)]
struct MyObj { struct MyObj {
@ -146,7 +146,7 @@ pub async fn test_field_visible() {
); );
} }
#[async_std::test] #[tokio::test]
pub async fn test_enum_value_visible() { pub async fn test_enum_value_visible() {
#[derive(Enum, Eq, PartialEq, Copy, Clone)] #[derive(Enum, Eq, PartialEq, Copy, Clone)]
enum MyEnum { enum MyEnum {
@ -204,7 +204,7 @@ pub async fn test_enum_value_visible() {
); );
} }
#[async_std::test] #[tokio::test]
pub async fn test_visible_fn() { pub async fn test_visible_fn() {
struct IsAdmin(bool); struct IsAdmin(bool);

View File

@ -1,7 +1,7 @@
use async_graphql::*; use async_graphql::*;
use std::collections::HashMap; use std::collections::HashMap;
#[async_std::test] #[tokio::test]
pub async fn test_json_scalar() { pub async fn test_json_scalar() {
#[derive(serde::Serialize, serde::Deserialize)] #[derive(serde::Serialize, serde::Deserialize)]
struct MyData(HashMap<String, i32>); struct MyData(HashMap<String, i32>);

View File

@ -3,7 +3,7 @@ use std::cmp::Ordering;
use std::collections::{BTreeSet, HashSet, LinkedList, VecDeque}; use std::collections::{BTreeSet, HashSet, LinkedList, VecDeque};
//noinspection ALL //noinspection ALL
#[async_std::test] #[tokio::test]
pub async fn test_list_type() { pub async fn test_list_type() {
#[derive(InputObject)] #[derive(InputObject)]
struct MyInput { struct MyInput {

View File

@ -1,6 +1,6 @@
use async_graphql::*; use async_graphql::*;
#[async_std::test] #[tokio::test]
pub async fn test_maybe_undefined_type() { pub async fn test_maybe_undefined_type() {
#[derive(InputObject)] #[derive(InputObject)]
struct MyInput { struct MyInput {

View File

@ -16,7 +16,7 @@ struct Object3 {
c: i32, c: i32,
} }
#[async_std::test] #[tokio::test]
pub async fn test_merged_object() { pub async fn test_merged_object() {
type MyObj = type MyObj =
MergedObject<Object1, MergedObject<Object2, MergedObject<Object3, MergedObjectTail>>>; MergedObject<Object1, MergedObject<Object2, MergedObject<Object3, MergedObjectTail>>>;
@ -55,7 +55,7 @@ pub async fn test_merged_object() {
); );
} }
#[async_std::test] #[tokio::test]
pub async fn test_merged_object_macro() { pub async fn test_merged_object_macro() {
#[derive(MergedObject)] #[derive(MergedObject)]
struct MyObj(Object1, Object2, Object3); struct MyObj(Object1, Object2, Object3);
@ -83,7 +83,7 @@ pub async fn test_merged_object_macro() {
); );
} }
#[async_std::test] #[tokio::test]
pub async fn test_merged_object_derive() { pub async fn test_merged_object_derive() {
#[derive(MergedObject)] #[derive(MergedObject)]
struct MyObj(Object1, Object2, Object3); struct MyObj(Object1, Object2, Object3);
@ -111,7 +111,7 @@ pub async fn test_merged_object_derive() {
); );
} }
#[async_std::test] #[tokio::test]
pub async fn test_merged_object_default() { pub async fn test_merged_object_default() {
mod a { mod a {
use super::*; use super::*;
@ -157,7 +157,7 @@ pub async fn test_merged_object_default() {
); );
} }
#[async_std::test] #[tokio::test]
pub async fn test_merged_subscription() { pub async fn test_merged_subscription() {
#[derive(Default)] #[derive(Default)]
struct Subscription1; struct Subscription1;
@ -226,7 +226,7 @@ pub async fn test_merged_subscription() {
} }
} }
#[async_std::test] #[tokio::test]
pub async fn test_merged_entity() { pub async fn test_merged_entity() {
#[derive(SimpleObject)] #[derive(SimpleObject)]
struct Fruit { struct Fruit {
@ -291,7 +291,7 @@ pub async fn test_merged_entity() {
); );
} }
#[async_std::test] #[tokio::test]
pub async fn test_issue_316() { pub async fn test_issue_316() {
#[derive(SimpleObject)] #[derive(SimpleObject)]
struct Fruit { struct Fruit {
@ -337,7 +337,7 @@ pub async fn test_issue_316() {
assert!(schema.execute("{ _service { sdl }}").await.is_ok()); assert!(schema.execute("{ _service { sdl }}").await.is_ok());
} }
#[async_std::test] #[tokio::test]
pub async fn test_issue_333() { pub async fn test_issue_333() {
#[derive(SimpleObject)] #[derive(SimpleObject)]
struct ObjectA<'a> { struct ObjectA<'a> {

View File

@ -1,6 +1,6 @@
use async_graphql::*; use async_graphql::*;
#[async_std::test] #[tokio::test]
pub async fn test_mut_args() { pub async fn test_mut_args() {
struct Query; struct Query;

View File

@ -1,9 +1,9 @@
use async_graphql::*; use async_graphql::*;
use async_std::sync::Mutex;
use std::sync::Arc; use std::sync::Arc;
use std::time::Duration; use std::time::Duration;
use tokio::sync::Mutex;
#[async_std::test] #[tokio::test]
pub async fn test_mutation_execution_order() { pub async fn test_mutation_execution_order() {
type List = Arc<Mutex<Vec<i32>>>; type List = Arc<Mutex<Vec<i32>>>;
@ -21,13 +21,13 @@ pub async fn test_mutation_execution_order() {
#[Object] #[Object]
impl MutationRoot { impl MutationRoot {
async fn append1(&self, ctx: &Context<'_>) -> bool { async fn append1(&self, ctx: &Context<'_>) -> bool {
async_std::task::sleep(Duration::from_secs(1)).await; tokio::time::sleep(Duration::from_secs(1)).await;
ctx.data_unchecked::<List>().lock().await.push(1); ctx.data_unchecked::<List>().lock().await.push(1);
true true
} }
async fn append2(&self, ctx: &Context<'_>) -> bool { async fn append2(&self, ctx: &Context<'_>) -> bool {
async_std::task::sleep(Duration::from_millis(500)).await; tokio::time::sleep(Duration::from_millis(500)).await;
ctx.data_unchecked::<List>().lock().await.push(2); ctx.data_unchecked::<List>().lock().await.push(2);
true true
} }
@ -42,7 +42,7 @@ pub async fn test_mutation_execution_order() {
assert_eq!(list.lock().await[1], 2); assert_eq!(list.lock().await[1], 2);
} }
#[async_std::test] #[tokio::test]
pub async fn test_mutation_fragment() { pub async fn test_mutation_fragment() {
struct QueryRoot; struct QueryRoot;

View File

@ -1,6 +1,6 @@
use async_graphql::*; use async_graphql::*;
#[async_std::test] #[tokio::test]
pub async fn test_optional_type() { pub async fn test_optional_type() {
#[derive(InputObject)] #[derive(InputObject)]
struct MyInput { struct MyInput {

View File

@ -1,4 +1,4 @@
#[async_std::test] #[tokio::test]
pub async fn test_object() { pub async fn test_object() {
macro_rules! test_data { macro_rules! test_data {
($test_name:ident) => { ($test_name:ident) => {
@ -19,7 +19,7 @@ pub async fn test_object() {
test_data!(A); test_data!(A);
} }
#[async_std::test] #[tokio::test]
pub async fn test_subscription() { pub async fn test_subscription() {
macro_rules! test_data { macro_rules! test_data {
($test_name:ident) => { ($test_name:ident) => {
@ -41,7 +41,7 @@ pub async fn test_subscription() {
test_data!(A); test_data!(A);
} }
#[async_std::test] #[tokio::test]
pub async fn test_scalar() { pub async fn test_scalar() {
macro_rules! test_data { macro_rules! test_data {
($test_name:ident) => { ($test_name:ident) => {

View File

@ -1,7 +1,7 @@
use async_graphql::*; use async_graphql::*;
use futures_util::stream::{Stream, StreamExt, TryStreamExt}; use futures_util::stream::{Stream, StreamExt, TryStreamExt};
#[async_std::test] #[tokio::test]
pub async fn test_input_value_custom_error() { pub async fn test_input_value_custom_error() {
#[derive(Enum, Copy, Clone, Eq, PartialEq)] #[derive(Enum, Copy, Clone, Eq, PartialEq)]
#[allow(non_camel_case_types)] #[allow(non_camel_case_types)]

View File

@ -1,7 +1,7 @@
use async_graphql::*; use async_graphql::*;
use futures_util::stream::{Stream, StreamExt}; use futures_util::stream::{Stream, StreamExt};
#[async_std::test] #[tokio::test]
pub async fn test_enum() { pub async fn test_enum() {
#[derive(Enum, Eq, PartialEq, Copy, Clone)] #[derive(Enum, Eq, PartialEq, Copy, Clone)]
#[graphql(rename_items = "camelCase")] #[graphql(rename_items = "camelCase")]
@ -32,7 +32,7 @@ pub async fn test_enum() {
); );
} }
#[async_std::test] #[tokio::test]
pub async fn test_simple_object() { pub async fn test_simple_object() {
#[derive(SimpleObject)] #[derive(SimpleObject)]
#[graphql(rename_fields = "UPPERCASE")] #[graphql(rename_fields = "UPPERCASE")]
@ -51,7 +51,7 @@ pub async fn test_simple_object() {
); );
} }
#[async_std::test] #[tokio::test]
pub async fn test_object() { pub async fn test_object() {
struct Query; struct Query;
@ -73,7 +73,7 @@ pub async fn test_object() {
); );
} }
#[async_std::test] #[tokio::test]
pub async fn test_input_object() { pub async fn test_input_object() {
#[derive(InputObject)] #[derive(InputObject)]
#[graphql(rename_fields = "snake_case")] #[graphql(rename_fields = "snake_case")]
@ -103,7 +103,7 @@ pub async fn test_input_object() {
); );
} }
#[async_std::test] #[tokio::test]
pub async fn test_subscription() { pub async fn test_subscription() {
struct Query; struct Query;

View File

@ -1,6 +1,6 @@
use async_graphql::*; use async_graphql::*;
#[async_std::test] #[tokio::test]
pub async fn test_fieldresult() { pub async fn test_fieldresult() {
struct Query; struct Query;

View File

@ -9,7 +9,7 @@ mod test_mod {
} }
} }
#[async_std::test] #[tokio::test]
pub async fn test_scalar_macro() { pub async fn test_scalar_macro() {
scalar!(test_mod::MyValue, "MV", "DESC"); scalar!(test_mod::MyValue, "MV", "DESC");

View File

@ -1,6 +1,6 @@
use async_graphql::*; use async_graphql::*;
#[async_std::test] #[tokio::test]
pub async fn test_schema_default() { pub async fn test_schema_default() {
#[derive(Default)] #[derive(Default)]
struct QueryRoot; struct QueryRoot;

View File

@ -10,7 +10,7 @@ impl QueryRoot {
} }
} }
#[async_std::test] #[tokio::test]
pub async fn test_subscription() { pub async fn test_subscription() {
#[derive(SimpleObject)] #[derive(SimpleObject)]
struct Event { struct Event {
@ -59,7 +59,7 @@ pub async fn test_subscription() {
} }
} }
#[async_std::test] #[tokio::test]
pub async fn test_subscription_with_ctx_data() { pub async fn test_subscription_with_ctx_data() {
struct QueryRoot; struct QueryRoot;
@ -109,7 +109,7 @@ pub async fn test_subscription_with_ctx_data() {
} }
} }
#[async_std::test] #[tokio::test]
pub async fn test_subscription_with_token() { pub async fn test_subscription_with_token() {
struct QueryRoot; struct QueryRoot;
@ -160,7 +160,7 @@ pub async fn test_subscription_with_token() {
} }
} }
#[async_std::test] #[tokio::test]
pub async fn test_subscription_inline_fragment() { pub async fn test_subscription_inline_fragment() {
#[derive(SimpleObject)] #[derive(SimpleObject)]
struct Event { struct Event {
@ -211,7 +211,7 @@ pub async fn test_subscription_inline_fragment() {
assert!(stream.next().await.is_none()); assert!(stream.next().await.is_none());
} }
#[async_std::test] #[tokio::test]
pub async fn test_subscription_fragment() { pub async fn test_subscription_fragment() {
#[derive(SimpleObject)] #[derive(SimpleObject)]
struct Event { struct Event {
@ -261,7 +261,7 @@ pub async fn test_subscription_fragment() {
assert!(stream.next().await.is_none()); assert!(stream.next().await.is_none());
} }
#[async_std::test] #[tokio::test]
pub async fn test_subscription_fragment2() { pub async fn test_subscription_fragment2() {
#[derive(SimpleObject)] #[derive(SimpleObject)]
struct Event { struct Event {
@ -312,7 +312,7 @@ pub async fn test_subscription_fragment2() {
assert!(stream.next().await.is_none()); assert!(stream.next().await.is_none());
} }
#[async_std::test] #[tokio::test]
pub async fn test_subscription_error() { pub async fn test_subscription_error() {
struct Event { struct Event {
value: i32, value: i32,
@ -369,7 +369,7 @@ pub async fn test_subscription_error() {
assert!(stream.next().await.is_none()); assert!(stream.next().await.is_none());
} }
#[async_std::test] #[tokio::test]
pub async fn test_subscription_fieldresult() { pub async fn test_subscription_fieldresult() {
struct SubscriptionRoot; struct SubscriptionRoot;

View File

@ -4,7 +4,7 @@ use futures_channel::mpsc;
use futures_util::stream::{Stream, StreamExt}; use futures_util::stream::{Stream, StreamExt};
use futures_util::SinkExt; use futures_util::SinkExt;
#[async_std::test] #[tokio::test]
pub async fn test_subscription_ws_transport() { pub async fn test_subscription_ws_transport() {
struct QueryRoot; struct QueryRoot;
@ -80,7 +80,7 @@ pub async fn test_subscription_ws_transport() {
); );
} }
#[async_std::test] #[tokio::test]
pub async fn test_subscription_ws_transport_with_token() { pub async fn test_subscription_ws_transport_with_token() {
struct Token(String); struct Token(String);
@ -174,7 +174,7 @@ pub async fn test_subscription_ws_transport_with_token() {
); );
} }
#[async_std::test] #[tokio::test]
pub async fn test_subscription_ws_transport_error() { pub async fn test_subscription_ws_transport_error() {
struct Event { struct Event {
value: i32, value: i32,
@ -270,7 +270,7 @@ pub async fn test_subscription_ws_transport_error() {
); );
} }
#[async_std::test] #[tokio::test]
pub async fn test_subscription_init_error() { pub async fn test_subscription_init_error() {
struct QueryRoot; struct QueryRoot;
@ -314,7 +314,7 @@ pub async fn test_subscription_init_error() {
); );
} }
#[async_std::test] #[tokio::test]
pub async fn test_subscription_too_many_initialisation_requests_error() { pub async fn test_subscription_too_many_initialisation_requests_error() {
struct QueryRoot; struct QueryRoot;
@ -369,7 +369,7 @@ pub async fn test_subscription_too_many_initialisation_requests_error() {
); );
} }
#[async_std::test] #[tokio::test]
pub async fn test_query_over_websocket() { pub async fn test_query_over_websocket() {
struct QueryRoot; struct QueryRoot;

View File

@ -4,7 +4,7 @@ use futures_channel::mpsc;
use futures_util::stream::{Stream, StreamExt}; use futures_util::stream::{Stream, StreamExt};
use futures_util::SinkExt; use futures_util::SinkExt;
#[async_std::test] #[tokio::test]
pub async fn test_subscription_ws_transport() { pub async fn test_subscription_ws_transport() {
struct QueryRoot; struct QueryRoot;
@ -80,7 +80,7 @@ pub async fn test_subscription_ws_transport() {
); );
} }
#[async_std::test] #[tokio::test]
pub async fn test_subscription_ws_transport_with_token() { pub async fn test_subscription_ws_transport_with_token() {
struct Token(String); struct Token(String);
@ -174,7 +174,7 @@ pub async fn test_subscription_ws_transport_with_token() {
); );
} }
#[async_std::test] #[tokio::test]
pub async fn test_subscription_ws_transport_error() { pub async fn test_subscription_ws_transport_error() {
struct Event { struct Event {
value: i32, value: i32,
@ -270,7 +270,7 @@ pub async fn test_subscription_ws_transport_error() {
); );
} }
#[async_std::test] #[tokio::test]
pub async fn test_subscription_too_many_initialisation_requests_error() { pub async fn test_subscription_too_many_initialisation_requests_error() {
struct QueryRoot; struct QueryRoot;
@ -330,7 +330,7 @@ pub async fn test_subscription_too_many_initialisation_requests_error() {
); );
} }
#[async_std::test] #[tokio::test]
pub async fn test_query_over_websocket() { pub async fn test_query_over_websocket() {
struct QueryRoot; struct QueryRoot;

View File

@ -1,6 +1,6 @@
use async_graphql::*; use async_graphql::*;
#[async_std::test] #[tokio::test]
pub async fn test_union_simple_object() { pub async fn test_union_simple_object() {
#[derive(SimpleObject)] #[derive(SimpleObject)]
struct MyObj { struct MyObj {
@ -44,7 +44,7 @@ pub async fn test_union_simple_object() {
); );
} }
#[async_std::test] #[tokio::test]
pub async fn test_union_simple_object2() { pub async fn test_union_simple_object2() {
#[derive(SimpleObject)] #[derive(SimpleObject)]
struct MyObj { struct MyObj {
@ -88,7 +88,7 @@ pub async fn test_union_simple_object2() {
); );
} }
#[async_std::test] #[tokio::test]
pub async fn test_multiple_unions() { pub async fn test_multiple_unions() {
struct MyObj; struct MyObj;
@ -165,7 +165,7 @@ pub async fn test_multiple_unions() {
); );
} }
#[async_std::test] #[tokio::test]
pub async fn test_multiple_objects_in_multiple_unions() { pub async fn test_multiple_objects_in_multiple_unions() {
struct MyObjOne; struct MyObjOne;
@ -242,7 +242,7 @@ pub async fn test_multiple_objects_in_multiple_unions() {
); );
} }
#[async_std::test] #[tokio::test]
pub async fn test_union_field_result() { pub async fn test_union_field_result() {
struct MyObj; struct MyObj;
@ -285,7 +285,7 @@ pub async fn test_union_field_result() {
); );
} }
#[async_std::test] #[tokio::test]
pub async fn test_union_flatten() { pub async fn test_union_flatten() {
#[derive(SimpleObject)] #[derive(SimpleObject)]
struct MyObj1 { struct MyObj1 {

View File

@ -1,8 +1,8 @@
use async_graphql::*; use async_graphql::*;
use async_std::stream::Stream;
use chrono::{DateTime, Utc}; use chrono::{DateTime, Utc};
use futures_util::stream::Stream;
#[async_std::test] #[tokio::test]
pub async fn test_object() { pub async fn test_object() {
/// Haha /// Haha
#[derive(Description, Default)] #[derive(Description, Default)]
@ -32,7 +32,7 @@ pub async fn test_object() {
); );
} }
#[async_std::test] #[tokio::test]
pub async fn test_object_with_lifetime() { pub async fn test_object_with_lifetime() {
/// Haha /// Haha
#[derive(Description, Default)] #[derive(Description, Default)]
@ -67,7 +67,7 @@ pub async fn test_object_with_lifetime() {
); );
} }
#[async_std::test] #[tokio::test]
pub async fn test_scalar() { pub async fn test_scalar() {
/// Haha /// Haha
#[derive(Description, Default)] #[derive(Description, Default)]
@ -101,7 +101,7 @@ pub async fn test_scalar() {
); );
} }
#[async_std::test] #[tokio::test]
pub async fn test_subscription() { pub async fn test_subscription() {
struct Query; struct Query;
@ -135,7 +135,7 @@ pub async fn test_subscription() {
); );
} }
#[async_std::test] #[tokio::test]
pub async fn test_override_description() { pub async fn test_override_description() {
/// Haha /// Haha
#[derive(SimpleObject)] #[derive(SimpleObject)]

View File

@ -1,7 +1,7 @@
use async_graphql::*; use async_graphql::*;
use std::collections::HashMap; use std::collections::HashMap;
#[async_std::test] #[tokio::test]
pub async fn test_variables() { pub async fn test_variables() {
struct QueryRoot; struct QueryRoot;
@ -39,7 +39,7 @@ pub async fn test_variables() {
); );
} }
#[async_std::test] #[tokio::test]
pub async fn test_variable_default_value() { pub async fn test_variable_default_value() {
struct QueryRoot; struct QueryRoot;
@ -68,7 +68,7 @@ pub async fn test_variable_default_value() {
); );
} }
#[async_std::test] #[tokio::test]
pub async fn test_variable_no_value() { pub async fn test_variable_no_value() {
struct QueryRoot; struct QueryRoot;
@ -99,7 +99,7 @@ pub async fn test_variable_no_value() {
); );
} }
#[async_std::test] #[tokio::test]
pub async fn test_variable_null() { pub async fn test_variable_null() {
struct QueryRoot; struct QueryRoot;
@ -130,7 +130,7 @@ pub async fn test_variable_null() {
); );
} }
#[async_std::test] #[tokio::test]
pub async fn test_variable_in_input_object() { pub async fn test_variable_in_input_object() {
#[derive(InputObject)] #[derive(InputObject)]
struct MyInput { struct MyInput {
@ -219,7 +219,7 @@ pub async fn test_variable_in_input_object() {
} }
} }
#[async_std::test] #[tokio::test]
pub async fn test_variables_enum() { pub async fn test_variables_enum() {
#[derive(Enum, Eq, PartialEq, Copy, Clone)] #[derive(Enum, Eq, PartialEq, Copy, Clone)]
enum MyEnum { enum MyEnum {
@ -267,7 +267,7 @@ pub async fn test_variables_enum() {
); );
} }
#[async_std::test] #[tokio::test]
pub async fn test_variables_json() { pub async fn test_variables_json() {
struct QueryRoot; struct QueryRoot;