From 4f477031183bfd68e2297a88c044daf0cee803eb Mon Sep 17 00:00:00 2001 From: Sunli Date: Fri, 12 Mar 2021 12:47:24 +0800 Subject: [PATCH] Switch the async runtime used for testing to Tokio. --- Cargo.toml | 2 +- src/context.rs | 2 +- src/dataloader/mod.rs | 6 ++-- src/extensions/analyzer.rs | 2 +- src/extensions/apollo_persisted_queries.rs | 2 +- src/extensions/tracing.rs | 2 +- src/lib.rs | 18 ++++++------ src/look_ahead.rs | 2 +- src/registry/cache_control.rs | 5 ++-- src/resolver_utils/scalar.rs | 2 +- src/types/connection/mod.rs | 5 ++-- src/types/external/cow.rs | 2 +- src/types/json.rs | 4 +-- src/types/maybe_undefined.rs | 5 ++-- src/types/string_number.rs | 2 +- tests/batch_request.rs | 2 +- tests/connection.rs | 2 +- tests/default_value.rs | 4 +-- tests/directive.rs | 6 ++-- tests/enum.rs | 6 ++-- tests/error_ext.rs | 2 +- tests/extension.rs | 2 +- tests/federation.rs | 6 ++-- tests/field_features.rs | 2 +- tests/fields_merge.rs | 6 ++-- tests/generic_types.rs | 8 +++--- tests/guard.rs | 10 +++---- tests/input_object.rs | 12 ++++---- tests/input_validators.rs | 28 +++++++++---------- tests/input_value.rs | 2 +- tests/interface.rs | 16 +++++------ tests/introspection.rs | 28 +++++++++---------- tests/introspection_visible.rs | 8 +++--- tests/json_type.rs | 2 +- tests/list.rs | 2 +- tests/maybe_undefined.rs | 2 +- tests/merged_object.rs | 16 +++++------ tests/mut_args.rs | 2 +- tests/mutation.rs | 10 +++---- tests/optional.rs | 2 +- tests/proc_macro_in_macro_rules.rs | 6 ++-- tests/raw_ident.rs | 2 +- tests/rename.rs | 10 +++---- tests/result.rs | 2 +- tests/scalar.rs | 2 +- tests/schema.rs | 2 +- tests/subscription.rs | 16 +++++------ tests/subscription_websocket_graphql_ws.rs | 12 ++++---- ...on_websocket_subscriptions_transport_ws.rs | 10 +++---- tests/union.rs | 12 ++++---- tests/use_type_description.rs | 12 ++++---- tests/variables.rs | 14 +++++----- 52 files changed, 172 insertions(+), 175 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 10577a5f..0e225d5a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -77,7 +77,7 @@ futures-timer = { version = "3.0.2", optional = true } futures-channel = { version = "0.3.8", optional = true } [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" [package.metadata.docs.rs] diff --git a/src/context.rs b/src/context.rs index 41190c7d..6cb7e80b 100644 --- a/src/context.rs +++ b/src/context.rs @@ -650,7 +650,7 @@ impl<'a> ContextBase<'a, &'a Positioned> { /// } /// } /// - /// async_std::task::block_on(async move { + /// tokio::runtime::Runtime::new().unwrap().block_on(async move { /// 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()); diff --git a/src/dataloader/mod.rs b/src/dataloader/mod.rs index 293b408c..47335799 100644 --- a/src/dataloader/mod.rs +++ b/src/dataloader/mod.rs @@ -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 query = r#" //! { @@ -249,7 +249,7 @@ mod tests { } } - #[async_std::test] + #[tokio::test] async fn test_dataloader() { let loader = Arc::new(DataLoader::new(MyLoader).max_batch_size(10)); assert_eq!( @@ -279,7 +279,7 @@ mod tests { ); } - #[async_std::test] + #[tokio::test] async fn test_duplicate_keys() { let loader = Arc::new(DataLoader::new(MyLoader).max_batch_size(10)); assert_eq!( diff --git a/src/extensions/analyzer.rs b/src/extensions/analyzer.rs index 200b6e8b..6e2962bc 100644 --- a/src/extensions/analyzer.rs +++ b/src/extensions/analyzer.rs @@ -72,7 +72,7 @@ mod tests { } } - #[async_std::test] + #[tokio::test] async fn analyzer() { let schema = Schema::build(Query, EmptyMutation, EmptySubscription) .extension(extensions::Analyzer) diff --git a/src/extensions/apollo_persisted_queries.rs b/src/extensions/apollo_persisted_queries.rs index acef8e74..4936abc5 100644 --- a/src/extensions/apollo_persisted_queries.rs +++ b/src/extensions/apollo_persisted_queries.rs @@ -116,7 +116,7 @@ impl Extension for ApolloPersistedQueriesExtension { #[cfg(test)] mod tests { - #[async_std::test] + #[tokio::test] async fn test() { use super::*; use crate::*; diff --git a/src/extensions/tracing.rs b/src/extensions/tracing.rs index fbd6a026..c9a796bb 100644 --- a/src/extensions/tracing.rs +++ b/src/extensions/tracing.rs @@ -50,7 +50,7 @@ impl TracingConfig { /// "span root" /// ); /// -/// async_std::task::block_on(async move { +/// tokio::runtime::Runtime::new().unwrap().block_on(async move { /// let request = Request::new("{ value }") /// .data(TracingConfig::default().parent_span(root_span)); /// schema.execute(request).await; diff --git a/src/lib.rs b/src/lib.rs index f0ed14a3..9418dadb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -348,7 +348,7 @@ pub type FieldResult = Result; /// } /// } /// -/// 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 res = schema.execute(r#"{ /// value @@ -406,7 +406,7 @@ pub type FieldResult = Result; /// } /// } /// -/// async_std::task::block_on(async move { +/// tokio::runtime::Runtime::new().unwrap().block_on(async move { /// let schema = Schema::new(QueryRoot, EmptyMutation, EmptySubscription); /// let res = schema.execute("{ objs { name } }").await.into_result().unwrap().data; /// assert_eq!(res, value!({ @@ -463,7 +463,7 @@ pub use async_graphql_derive::Object; /// 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 res = schema.execute("{ value }").await.into_result().unwrap().data; /// 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 res = schema.execute("{ value1 value2 }").await.into_result().unwrap().data; /// 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 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 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 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 res = schema.execute("{ value }").await.into_result().unwrap().data; @@ -1047,7 +1047,7 @@ pub use async_graphql_derive::MergedSubscription; /// 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); /// assert_eq!( /// schema diff --git a/src/look_ahead.rs b/src/look_ahead.rs index a12f5bbc..15b5c1c0 100644 --- a/src/look_ahead.rs +++ b/src/look_ahead.rs @@ -70,7 +70,7 @@ fn find<'a>( mod tests { use crate::*; - #[async_std::test] + #[tokio::test] async fn test_look_ahead() { #[derive(SimpleObject)] #[graphql(internal)] diff --git a/src/registry/cache_control.rs b/src/registry/cache_control.rs index 89545e80..8d3beac8 100644 --- a/src/registry/cache_control.rs +++ b/src/registry/cache_control.rs @@ -20,13 +20,12 @@ /// } /// } /// -/// #[async_std::main] -/// async fn main() { +/// tokio::runtime::Runtime::new().unwrap().block_on(async { /// 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("{ 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 }); -/// } +/// }); /// ``` #[derive(Clone, Copy, PartialEq, Eq, Debug)] pub struct CacheControl { diff --git a/src/resolver_utils/scalar.rs b/src/resolver_utils/scalar.rs index 14c67ce5..2a788345 100644 --- a/src/resolver_utils/scalar.rs +++ b/src/resolver_utils/scalar.rs @@ -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 res = schema.execute(r#"{ value(input: {a: 10, b: {v1: 1, v2: 2} }) }"#).await.into_result().unwrap().data; /// assert_eq!(res, value!({ diff --git a/src/types/connection/mod.rs b/src/types/connection/mod.rs index 4a666d20..bb8e8b7f 100644 --- a/src/types/connection/mod.rs +++ b/src/types/connection/mod.rs @@ -67,8 +67,7 @@ pub struct EmptyFields; /// } /// } /// -/// #[async_std::main] -/// async fn main() { +/// tokio::runtime::Runtime::new().unwrap().block_on(async { /// let schema = Schema::new(QueryRoot, EmptyMutation, EmptySubscription); /// /// 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( after: Option, diff --git a/src/types/external/cow.rs b/src/types/external/cow.rs index 9e037ccd..e6dc1189 100644 --- a/src/types/external/cow.rs +++ b/src/types/external/cow.rs @@ -36,7 +36,7 @@ mod test { use crate::*; use std::borrow::Cow; - #[async_std::test] + #[tokio::test] async fn test_cow_type() { struct Query { obj: MyObj, diff --git a/src/types/json.rs b/src/types/json.rs index 3bbdf045..c49fa7fb 100644 --- a/src/types/json.rs +++ b/src/types/json.rs @@ -106,7 +106,7 @@ mod test { use serde::{Deserialize, Serialize}; use std::collections::HashMap; - #[async_std::test] + #[tokio::test] async fn test_json_type() { #[derive(Serialize, Deserialize)] struct MyStruct { @@ -138,7 +138,7 @@ mod test { ); } - #[async_std::test] + #[tokio::test] async fn test_output_json_type() { #[derive(Serialize)] struct MyStruct { diff --git a/src/types/maybe_undefined.rs b/src/types/maybe_undefined.rs index 5e776ca1..69693b50 100644 --- a/src/types/maybe_undefined.rs +++ b/src/types/maybe_undefined.rs @@ -28,8 +28,7 @@ use crate::{registry, InputType, InputValueError, InputValueResult, Type, Value} /// } /// } /// -/// #[async_std::main] -/// async fn main() { +/// tokio::runtime::Runtime::new().unwrap().block_on(async { /// let schema = Schema::new(Query, EmptyMutation, EmptySubscription); /// let query = r#" /// { @@ -45,7 +44,7 @@ use crate::{registry, InputType, InputValueError, InputValueResult, Type, Value} /// "v3": 2, /// }) /// ); -/// } +/// }); /// ``` #[allow(missing_docs)] #[derive(Copy, Clone, PartialEq, PartialOrd, Eq, Ord, Debug, Hash)] diff --git a/src/types/string_number.rs b/src/types/string_number.rs index 741c4e46..70734ebc 100644 --- a/src/types/string_number.rs +++ b/src/types/string_number.rs @@ -40,7 +40,7 @@ where mod test { use crate::*; - #[async_std::test] + #[tokio::test] async fn test_string_number() { struct Query; diff --git a/tests/batch_request.rs b/tests/batch_request.rs index b698a476..9dcf351c 100644 --- a/tests/batch_request.rs +++ b/tests/batch_request.rs @@ -1,6 +1,6 @@ use async_graphql::*; -#[async_std::test] +#[tokio::test] pub async fn test_batch_request() { struct Query; diff --git a/tests/connection.rs b/tests/connection.rs index 69ac4537..d0f9b792 100644 --- a/tests/connection.rs +++ b/tests/connection.rs @@ -1,7 +1,7 @@ use async_graphql::connection::*; use async_graphql::*; -#[async_std::test] +#[tokio::test] pub async fn test_connection_additional_fields() { struct QueryRoot; diff --git a/tests/default_value.rs b/tests/default_value.rs index d5d38ee5..75b86c3b 100644 --- a/tests/default_value.rs +++ b/tests/default_value.rs @@ -1,6 +1,6 @@ use async_graphql::*; -#[async_std::test] +#[tokio::test] pub async fn test_default_value_arg() { 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() { #[derive(InputObject)] struct MyInput { diff --git a/tests/directive.rs b/tests/directive.rs index ef58e153..3a922345 100644 --- a/tests/directive.rs +++ b/tests/directive.rs @@ -1,6 +1,6 @@ use async_graphql::*; -#[async_std::test] +#[tokio::test] pub async fn test_directive_skip() { struct QueryRoot; @@ -30,7 +30,7 @@ pub async fn test_directive_skip() { ); } -#[async_std::test] +#[tokio::test] pub async fn test_directive_include() { struct QueryRoot; @@ -60,7 +60,7 @@ pub async fn test_directive_include() { ); } -#[async_std::test] +#[tokio::test] pub async fn test_directive_ifdef() { struct QueryRoot; diff --git a/tests/enum.rs b/tests/enum.rs index 837fe19b..29981d09 100644 --- a/tests/enum.rs +++ b/tests/enum.rs @@ -1,6 +1,6 @@ use async_graphql::*; -#[async_std::test] +#[tokio::test] pub async fn test_enum_type() { #[derive(Enum, Copy, Clone, Eq, PartialEq)] 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() { 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() { #[derive(Enum, Copy, Clone, Eq, PartialEq)] #[graphql(remote = "remote::RemoteEnum")] diff --git a/tests/error_ext.rs b/tests/error_ext.rs index f89b1791..b26c4fc6 100644 --- a/tests/error_ext.rs +++ b/tests/error_ext.rs @@ -1,6 +1,6 @@ use async_graphql::*; -#[async_std::test] +#[tokio::test] pub async fn test_error_extensions() { struct Query; diff --git a/tests/extension.rs b/tests/extension.rs index f0e05186..e2104810 100644 --- a/tests/extension.rs +++ b/tests/extension.rs @@ -3,7 +3,7 @@ use async_graphql::*; use spin::Mutex; use std::sync::Arc; -#[async_std::test] +#[tokio::test] pub async fn test_extension_ctx() { #[derive(Default, Clone)] struct MyData(Arc>); diff --git a/tests/federation.rs b/tests/federation.rs index 2b6308ab..36279fa1 100644 --- a/tests/federation.rs +++ b/tests/federation.rs @@ -6,7 +6,7 @@ use std::convert::Infallible; use async_graphql::dataloader::{DataLoader, Loader}; use async_graphql::*; -#[async_std::test] +#[tokio::test] pub async fn test_nested_key() { #[derive(InputObject)] struct MyInputA { @@ -66,7 +66,7 @@ pub async fn test_nested_key() { ); } -#[async_std::test] +#[tokio::test] pub async fn test_federation() { struct User { id: ID, @@ -151,7 +151,7 @@ pub async fn test_federation() { ); } -#[async_std::test] +#[tokio::test] pub async fn test_find_entity_with_context() { struct MyLoader; diff --git a/tests/field_features.rs b/tests/field_features.rs index b5ec9327..3c67c91b 100644 --- a/tests/field_features.rs +++ b/tests/field_features.rs @@ -3,7 +3,7 @@ use async_graphql::*; use futures_util::stream::{Stream, StreamExt}; -#[async_std::test] +#[tokio::test] pub async fn test_field_features() { #[derive(SimpleObject)] struct MyObj { diff --git a/tests/fields_merge.rs b/tests/fields_merge.rs index 1391b6ba..b29f1b6f 100644 --- a/tests/fields_merge.rs +++ b/tests/fields_merge.rs @@ -1,6 +1,6 @@ use async_graphql::*; -#[async_std::test] +#[tokio::test] pub async fn test_field_merge() { struct Query; @@ -41,7 +41,7 @@ pub async fn test_field_merge() { ); } -#[async_std::test] +#[tokio::test] pub async fn test_field_object_merge() { #[derive(SimpleObject)] 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() { #[derive(SimpleObject)] struct MyObject { diff --git a/tests/generic_types.rs b/tests/generic_types.rs index bcf7f17f..6befa0dd 100644 --- a/tests/generic_types.rs +++ b/tests/generic_types.rs @@ -1,7 +1,7 @@ use async_graphql::*; use futures_util::stream::{Stream, StreamExt}; -#[async_std::test] +#[tokio::test] pub async fn test_generic_object() { struct MyObj { value: T, @@ -49,7 +49,7 @@ pub async fn test_generic_object() { ); } -#[async_std::test] +#[tokio::test] pub async fn test_input_object_generic() { #[derive(InputObject)] #[graphql( @@ -148,7 +148,7 @@ pub async fn test_input_object_generic() { ); } -#[async_std::test] +#[tokio::test] pub async fn test_generic_simple_object() { #[derive(SimpleObject)] #[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() { struct MySubscription { values: Vec, diff --git a/tests/guard.rs b/tests/guard.rs index 389303e0..1b898016 100644 --- a/tests/guard.rs +++ b/tests/guard.rs @@ -57,7 +57,7 @@ impl Guard for AgeGuard { } } -#[async_std::test] +#[tokio::test] pub async fn test_guard_simple_rule() { #[derive(SimpleObject)] 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() { #[derive(SimpleObject)] 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() { #[derive(SimpleObject)] 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() { #[derive(SimpleObject)] 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() { #[derive(SimpleObject)] struct Query { diff --git a/tests/input_object.rs b/tests/input_object.rs index f60e5853..eb0cce85 100644 --- a/tests/input_object.rs +++ b/tests/input_object.rs @@ -1,6 +1,6 @@ use async_graphql::*; -#[async_std::test] +#[tokio::test] pub async fn test_input_object_default_value() { #[derive(InputObject)] 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() { 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() { #[derive(InputObject, Debug, Eq, PartialEq)] 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() { #[derive(InputObject, Debug, Eq, PartialEq)] 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() { #[derive(InputObject)] 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() { #[derive(InputObject)] struct MyInput { diff --git a/tests/input_validators.rs b/tests/input_validators.rs index 4977f4bb..ce47c560 100644 --- a/tests/input_validators.rs +++ b/tests/input_validators.rs @@ -4,7 +4,7 @@ use async_graphql::validators::{ }; use async_graphql::*; -#[async_std::test] +#[tokio::test] pub async fn test_input_validator_string_min_length() { 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() { 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() { 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() { struct QueryRootWithColon; 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() { 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() { 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() { 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() { 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() { 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() { 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() { 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() { 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() { 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() { struct QueryRoot; diff --git a/tests/input_value.rs b/tests/input_value.rs index 6ea84979..aa3e04bb 100644 --- a/tests/input_value.rs +++ b/tests/input_value.rs @@ -1,6 +1,6 @@ use async_graphql::*; -#[async_std::test] +#[tokio::test] pub async fn test_input_value_custom_error() { struct Query; diff --git a/tests/interface.rs b/tests/interface.rs index 12aaa66f..d2ad6dcb 100644 --- a/tests/interface.rs +++ b/tests/interface.rs @@ -1,6 +1,6 @@ use async_graphql::*; -#[async_std::test] +#[tokio::test] pub async fn test_interface_simple_object() { #[derive(SimpleObject)] 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() { #[derive(SimpleObject)] struct MyObj { @@ -90,7 +90,7 @@ pub async fn test_interface_simple_object2() { ); } -#[async_std::test] +#[tokio::test] pub async fn test_multiple_interfaces() { 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() { 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() { 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() { 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() { #[derive(Interface)] #[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() { #[derive(Interface)] #[graphql(field( diff --git a/tests/introspection.rs b/tests/introspection.rs index 9b2fbefd..1079795f 100644 --- a/tests/introspection.rs +++ b/tests/introspection.rs @@ -1,5 +1,5 @@ use async_graphql::*; -use async_std::stream::{self, Stream}; +use futures_util::stream::{self, Stream}; #[derive(Clone, Debug)] struct Circle { @@ -171,11 +171,11 @@ impl Subscription { &self, #[graphql(default = 1)] step: i32, ) -> impl Stream { - stream::once(step) + stream::once(async move { step }) } } -// #[async_std::test] +// #[tokio::test] // pub async fn test_introspection_schema() { // let schema = Schema::new(Query, Mutation, Subscription); @@ -219,7 +219,7 @@ impl Subscription { // assert_eq!(res, res_json) // } -// #[async_std::test] +// #[tokio::test] // pub async fn test_introspection_documentation() { // let schema = Schema::new(Query, EmptyMutation, EmptySubscription); // @@ -286,7 +286,7 @@ impl Subscription { // assert_eq!(res, res_json) // } -#[async_std::test] +#[tokio::test] pub async fn test_introspection_deprecation() { let schema = Schema::new(Query, EmptyMutation, EmptySubscription); @@ -543,7 +543,7 @@ pub async fn test_introspection_deprecation() { assert_eq!(res, res_json); } -#[async_std::test] +#[tokio::test] pub async fn test_introspection_type_kind() { let schema = Schema::new(Query, Mutation, EmptySubscription); @@ -702,7 +702,7 @@ pub async fn test_introspection_type_kind() { assert_eq!(res, res_json); } -#[async_std::test] +#[tokio::test] pub async fn test_introspection_scalar() { let schema = Schema::new(Query, Mutation, EmptySubscription); @@ -729,7 +729,7 @@ pub async fn test_introspection_scalar() { assert_eq!(res, res_json) } -#[async_std::test] +#[tokio::test] pub async fn test_introspection_union() { let schema = Schema::new(Query, Mutation, EmptySubscription); @@ -765,7 +765,7 @@ pub async fn test_introspection_union() { assert_eq!(res, res_json) } -#[async_std::test] +#[tokio::test] pub async fn test_introspection_interface() { let schema = Schema::new(Query, EmptyMutation, EmptySubscription); @@ -843,7 +843,7 @@ pub async fn test_introspection_interface() { assert_eq!(res, res_json); } -#[async_std::test] +#[tokio::test] pub async fn test_introspection_enum() { let schema = Schema::new(Query, Mutation, EmptySubscription); @@ -892,7 +892,7 @@ pub async fn test_introspection_enum() { assert_eq!(res, res_json) } -#[async_std::test] +#[tokio::test] pub async fn test_introspection_input_object() { let schema = Schema::new(Query, Mutation, EmptySubscription); @@ -925,7 +925,7 @@ pub async fn test_introspection_input_object() { assert_eq!(res, res_json) } -#[async_std::test] +#[tokio::test] pub async fn test_introspection_mutation() { let schema = Schema::new(Query, Mutation, EmptySubscription); @@ -973,7 +973,7 @@ pub async fn test_introspection_mutation() { assert_eq!(res, res_json) } -#[async_std::test] +#[tokio::test] pub async fn test_introspection_subscription() { let schema = Schema::new(Query, EmptyMutation, Subscription); @@ -1021,7 +1021,7 @@ pub async fn test_introspection_subscription() { assert_eq!(res, res_json) } -// #[async_std::test] +// #[tokio::test] // pub async fn test_introspection_full() { // let schema = Schema::new(Query, EmptyMutation, Subscription); // diff --git a/tests/introspection_visible.rs b/tests/introspection_visible.rs index a2fddf94..955e70d3 100644 --- a/tests/introspection_visible.rs +++ b/tests/introspection_visible.rs @@ -1,7 +1,7 @@ use async_graphql::*; use serde::Deserialize; -#[async_std::test] +#[tokio::test] pub async fn test_type_visible() { #[derive(SimpleObject)] #[graphql(visible = false)] @@ -67,7 +67,7 @@ pub async fn test_type_visible() { .is_none()); } -#[async_std::test] +#[tokio::test] pub async fn test_field_visible() { #[derive(SimpleObject)] struct MyObj { @@ -146,7 +146,7 @@ pub async fn test_field_visible() { ); } -#[async_std::test] +#[tokio::test] pub async fn test_enum_value_visible() { #[derive(Enum, Eq, PartialEq, Copy, Clone)] enum MyEnum { @@ -204,7 +204,7 @@ pub async fn test_enum_value_visible() { ); } -#[async_std::test] +#[tokio::test] pub async fn test_visible_fn() { struct IsAdmin(bool); diff --git a/tests/json_type.rs b/tests/json_type.rs index f5e997e9..1f6e2c91 100644 --- a/tests/json_type.rs +++ b/tests/json_type.rs @@ -1,7 +1,7 @@ use async_graphql::*; use std::collections::HashMap; -#[async_std::test] +#[tokio::test] pub async fn test_json_scalar() { #[derive(serde::Serialize, serde::Deserialize)] struct MyData(HashMap); diff --git a/tests/list.rs b/tests/list.rs index fd4795f2..100ed610 100644 --- a/tests/list.rs +++ b/tests/list.rs @@ -3,7 +3,7 @@ use std::cmp::Ordering; use std::collections::{BTreeSet, HashSet, LinkedList, VecDeque}; //noinspection ALL -#[async_std::test] +#[tokio::test] pub async fn test_list_type() { #[derive(InputObject)] struct MyInput { diff --git a/tests/maybe_undefined.rs b/tests/maybe_undefined.rs index 0ed1edf7..da68a8d2 100644 --- a/tests/maybe_undefined.rs +++ b/tests/maybe_undefined.rs @@ -1,6 +1,6 @@ use async_graphql::*; -#[async_std::test] +#[tokio::test] pub async fn test_maybe_undefined_type() { #[derive(InputObject)] struct MyInput { diff --git a/tests/merged_object.rs b/tests/merged_object.rs index bf43300e..4ec13cbb 100644 --- a/tests/merged_object.rs +++ b/tests/merged_object.rs @@ -16,7 +16,7 @@ struct Object3 { c: i32, } -#[async_std::test] +#[tokio::test] pub async fn test_merged_object() { type MyObj = MergedObject>>; @@ -55,7 +55,7 @@ pub async fn test_merged_object() { ); } -#[async_std::test] +#[tokio::test] pub async fn test_merged_object_macro() { #[derive(MergedObject)] 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() { #[derive(MergedObject)] 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() { mod a { use super::*; @@ -157,7 +157,7 @@ pub async fn test_merged_object_default() { ); } -#[async_std::test] +#[tokio::test] pub async fn test_merged_subscription() { #[derive(Default)] struct Subscription1; @@ -226,7 +226,7 @@ pub async fn test_merged_subscription() { } } -#[async_std::test] +#[tokio::test] pub async fn test_merged_entity() { #[derive(SimpleObject)] struct Fruit { @@ -291,7 +291,7 @@ pub async fn test_merged_entity() { ); } -#[async_std::test] +#[tokio::test] pub async fn test_issue_316() { #[derive(SimpleObject)] struct Fruit { @@ -337,7 +337,7 @@ pub async fn test_issue_316() { assert!(schema.execute("{ _service { sdl }}").await.is_ok()); } -#[async_std::test] +#[tokio::test] pub async fn test_issue_333() { #[derive(SimpleObject)] struct ObjectA<'a> { diff --git a/tests/mut_args.rs b/tests/mut_args.rs index 336fc7db..58325a3d 100644 --- a/tests/mut_args.rs +++ b/tests/mut_args.rs @@ -1,6 +1,6 @@ use async_graphql::*; -#[async_std::test] +#[tokio::test] pub async fn test_mut_args() { struct Query; diff --git a/tests/mutation.rs b/tests/mutation.rs index 5aa1e792..389f8a60 100644 --- a/tests/mutation.rs +++ b/tests/mutation.rs @@ -1,9 +1,9 @@ use async_graphql::*; -use async_std::sync::Mutex; use std::sync::Arc; use std::time::Duration; +use tokio::sync::Mutex; -#[async_std::test] +#[tokio::test] pub async fn test_mutation_execution_order() { type List = Arc>>; @@ -21,13 +21,13 @@ pub async fn test_mutation_execution_order() { #[Object] impl MutationRoot { 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::().lock().await.push(1); true } 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::().lock().await.push(2); true } @@ -42,7 +42,7 @@ pub async fn test_mutation_execution_order() { assert_eq!(list.lock().await[1], 2); } -#[async_std::test] +#[tokio::test] pub async fn test_mutation_fragment() { struct QueryRoot; diff --git a/tests/optional.rs b/tests/optional.rs index 1eb4ed9a..82c4a3e0 100644 --- a/tests/optional.rs +++ b/tests/optional.rs @@ -1,6 +1,6 @@ use async_graphql::*; -#[async_std::test] +#[tokio::test] pub async fn test_optional_type() { #[derive(InputObject)] struct MyInput { diff --git a/tests/proc_macro_in_macro_rules.rs b/tests/proc_macro_in_macro_rules.rs index 0cf69e88..d7bf54d1 100644 --- a/tests/proc_macro_in_macro_rules.rs +++ b/tests/proc_macro_in_macro_rules.rs @@ -1,4 +1,4 @@ -#[async_std::test] +#[tokio::test] pub async fn test_object() { macro_rules! test_data { ($test_name:ident) => { @@ -19,7 +19,7 @@ pub async fn test_object() { test_data!(A); } -#[async_std::test] +#[tokio::test] pub async fn test_subscription() { macro_rules! test_data { ($test_name:ident) => { @@ -41,7 +41,7 @@ pub async fn test_subscription() { test_data!(A); } -#[async_std::test] +#[tokio::test] pub async fn test_scalar() { macro_rules! test_data { ($test_name:ident) => { diff --git a/tests/raw_ident.rs b/tests/raw_ident.rs index b35c8de7..8360732d 100644 --- a/tests/raw_ident.rs +++ b/tests/raw_ident.rs @@ -1,7 +1,7 @@ use async_graphql::*; use futures_util::stream::{Stream, StreamExt, TryStreamExt}; -#[async_std::test] +#[tokio::test] pub async fn test_input_value_custom_error() { #[derive(Enum, Copy, Clone, Eq, PartialEq)] #[allow(non_camel_case_types)] diff --git a/tests/rename.rs b/tests/rename.rs index 477e032d..eb1bb809 100644 --- a/tests/rename.rs +++ b/tests/rename.rs @@ -1,7 +1,7 @@ use async_graphql::*; use futures_util::stream::{Stream, StreamExt}; -#[async_std::test] +#[tokio::test] pub async fn test_enum() { #[derive(Enum, Eq, PartialEq, Copy, Clone)] #[graphql(rename_items = "camelCase")] @@ -32,7 +32,7 @@ pub async fn test_enum() { ); } -#[async_std::test] +#[tokio::test] pub async fn test_simple_object() { #[derive(SimpleObject)] #[graphql(rename_fields = "UPPERCASE")] @@ -51,7 +51,7 @@ pub async fn test_simple_object() { ); } -#[async_std::test] +#[tokio::test] pub async fn test_object() { struct Query; @@ -73,7 +73,7 @@ pub async fn test_object() { ); } -#[async_std::test] +#[tokio::test] pub async fn test_input_object() { #[derive(InputObject)] #[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() { struct Query; diff --git a/tests/result.rs b/tests/result.rs index a100e9bf..deec300e 100644 --- a/tests/result.rs +++ b/tests/result.rs @@ -1,6 +1,6 @@ use async_graphql::*; -#[async_std::test] +#[tokio::test] pub async fn test_fieldresult() { struct Query; diff --git a/tests/scalar.rs b/tests/scalar.rs index a8b956d6..414dd109 100644 --- a/tests/scalar.rs +++ b/tests/scalar.rs @@ -9,7 +9,7 @@ mod test_mod { } } -#[async_std::test] +#[tokio::test] pub async fn test_scalar_macro() { scalar!(test_mod::MyValue, "MV", "DESC"); diff --git a/tests/schema.rs b/tests/schema.rs index 3e4ca897..a82a8a4a 100644 --- a/tests/schema.rs +++ b/tests/schema.rs @@ -1,6 +1,6 @@ use async_graphql::*; -#[async_std::test] +#[tokio::test] pub async fn test_schema_default() { #[derive(Default)] struct QueryRoot; diff --git a/tests/subscription.rs b/tests/subscription.rs index 7bef6aaf..7bb77504 100644 --- a/tests/subscription.rs +++ b/tests/subscription.rs @@ -10,7 +10,7 @@ impl QueryRoot { } } -#[async_std::test] +#[tokio::test] pub async fn test_subscription() { #[derive(SimpleObject)] struct Event { @@ -59,7 +59,7 @@ pub async fn test_subscription() { } } -#[async_std::test] +#[tokio::test] pub async fn test_subscription_with_ctx_data() { 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() { 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() { #[derive(SimpleObject)] struct Event { @@ -211,7 +211,7 @@ pub async fn test_subscription_inline_fragment() { assert!(stream.next().await.is_none()); } -#[async_std::test] +#[tokio::test] pub async fn test_subscription_fragment() { #[derive(SimpleObject)] struct Event { @@ -261,7 +261,7 @@ pub async fn test_subscription_fragment() { assert!(stream.next().await.is_none()); } -#[async_std::test] +#[tokio::test] pub async fn test_subscription_fragment2() { #[derive(SimpleObject)] struct Event { @@ -312,7 +312,7 @@ pub async fn test_subscription_fragment2() { assert!(stream.next().await.is_none()); } -#[async_std::test] +#[tokio::test] pub async fn test_subscription_error() { struct Event { value: i32, @@ -369,7 +369,7 @@ pub async fn test_subscription_error() { assert!(stream.next().await.is_none()); } -#[async_std::test] +#[tokio::test] pub async fn test_subscription_fieldresult() { struct SubscriptionRoot; diff --git a/tests/subscription_websocket_graphql_ws.rs b/tests/subscription_websocket_graphql_ws.rs index 275fd9cb..13f21d7a 100644 --- a/tests/subscription_websocket_graphql_ws.rs +++ b/tests/subscription_websocket_graphql_ws.rs @@ -4,7 +4,7 @@ use futures_channel::mpsc; use futures_util::stream::{Stream, StreamExt}; use futures_util::SinkExt; -#[async_std::test] +#[tokio::test] pub async fn test_subscription_ws_transport() { 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() { 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() { struct Event { 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() { 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() { 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() { struct QueryRoot; diff --git a/tests/subscription_websocket_subscriptions_transport_ws.rs b/tests/subscription_websocket_subscriptions_transport_ws.rs index be165d08..57d74be0 100644 --- a/tests/subscription_websocket_subscriptions_transport_ws.rs +++ b/tests/subscription_websocket_subscriptions_transport_ws.rs @@ -4,7 +4,7 @@ use futures_channel::mpsc; use futures_util::stream::{Stream, StreamExt}; use futures_util::SinkExt; -#[async_std::test] +#[tokio::test] pub async fn test_subscription_ws_transport() { 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() { 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() { struct Event { 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() { 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() { struct QueryRoot; diff --git a/tests/union.rs b/tests/union.rs index 01951e59..6768b02c 100644 --- a/tests/union.rs +++ b/tests/union.rs @@ -1,6 +1,6 @@ use async_graphql::*; -#[async_std::test] +#[tokio::test] pub async fn test_union_simple_object() { #[derive(SimpleObject)] 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() { #[derive(SimpleObject)] struct MyObj { @@ -88,7 +88,7 @@ pub async fn test_union_simple_object2() { ); } -#[async_std::test] +#[tokio::test] pub async fn test_multiple_unions() { 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() { 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() { struct MyObj; @@ -285,7 +285,7 @@ pub async fn test_union_field_result() { ); } -#[async_std::test] +#[tokio::test] pub async fn test_union_flatten() { #[derive(SimpleObject)] struct MyObj1 { diff --git a/tests/use_type_description.rs b/tests/use_type_description.rs index 9c27889a..f357517c 100644 --- a/tests/use_type_description.rs +++ b/tests/use_type_description.rs @@ -1,8 +1,8 @@ use async_graphql::*; -use async_std::stream::Stream; use chrono::{DateTime, Utc}; +use futures_util::stream::Stream; -#[async_std::test] +#[tokio::test] pub async fn test_object() { /// Haha #[derive(Description, Default)] @@ -32,7 +32,7 @@ pub async fn test_object() { ); } -#[async_std::test] +#[tokio::test] pub async fn test_object_with_lifetime() { /// Haha #[derive(Description, Default)] @@ -67,7 +67,7 @@ pub async fn test_object_with_lifetime() { ); } -#[async_std::test] +#[tokio::test] pub async fn test_scalar() { /// Haha #[derive(Description, Default)] @@ -101,7 +101,7 @@ pub async fn test_scalar() { ); } -#[async_std::test] +#[tokio::test] pub async fn test_subscription() { struct Query; @@ -135,7 +135,7 @@ pub async fn test_subscription() { ); } -#[async_std::test] +#[tokio::test] pub async fn test_override_description() { /// Haha #[derive(SimpleObject)] diff --git a/tests/variables.rs b/tests/variables.rs index 9ef58cff..0239c216 100644 --- a/tests/variables.rs +++ b/tests/variables.rs @@ -1,7 +1,7 @@ use async_graphql::*; use std::collections::HashMap; -#[async_std::test] +#[tokio::test] pub async fn test_variables() { struct QueryRoot; @@ -39,7 +39,7 @@ pub async fn test_variables() { ); } -#[async_std::test] +#[tokio::test] pub async fn test_variable_default_value() { 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() { struct QueryRoot; @@ -99,7 +99,7 @@ pub async fn test_variable_no_value() { ); } -#[async_std::test] +#[tokio::test] pub async fn test_variable_null() { 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() { #[derive(InputObject)] 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() { #[derive(Enum, Eq, PartialEq, Copy, Clone)] enum MyEnum { @@ -267,7 +267,7 @@ pub async fn test_variables_enum() { ); } -#[async_std::test] +#[tokio::test] pub async fn test_variables_json() { struct QueryRoot;