Fix unit tests for latest nightly

This commit is contained in:
tyranron 2024-03-12 16:53:09 +02:00
parent 847a38a4c6
commit 86b5319315
No known key found for this signature in database
GPG key ID: 762E144FB230A4F0
8 changed files with 33 additions and 28 deletions

View file

@ -1,9 +1,4 @@
use std::{
char, fmt,
iter::{Iterator, Peekable},
result::Result,
str::CharIndices,
};
use std::{char, fmt, iter::Peekable, str::CharIndices};
use crate::parser::{SourcePosition, Spanning};

View file

@ -1,4 +1,4 @@
use std::{error::Error, fmt, result::Result};
use std::{error::Error, fmt};
use smartstring::alias::String;

View file

@ -1,10 +1,7 @@
//! Types used to describe a `GraphQL` schema
use juniper::IntoFieldError;
use std::{
borrow::{Cow, ToOwned},
fmt,
};
use std::{borrow::Cow, fmt};
use crate::{
ast::{FromInputValue, InputValue, Type},

View file

@ -1,6 +1,4 @@
use std::{
char, convert::From, fmt, marker::PhantomData, ops::Deref, rc::Rc, thread::JoinHandle, u32,
};
use std::{char, fmt, marker::PhantomData, ops::Deref, rc::Rc, thread::JoinHandle, u32};
use serde::{Deserialize, Serialize};

View file

@ -1,4 +1,4 @@
use std::{collections::HashSet, iter::Iterator};
use std::collections::HashSet;
use crate::{
ast::InputValue,

View file

@ -611,16 +611,21 @@ where
#[cfg(test)]
mod test {
use std::{convert::Infallible, io};
use std::{convert::Infallible, io, sync::Arc, time::Duration};
use juniper::{
futures::sink::SinkExt,
futures::{
future::{self, FutureExt as _},
sink::SinkExt,
stream::{self, BoxStream, StreamExt as _},
},
graphql_input_value, graphql_object, graphql_subscription, graphql_value, graphql_vars,
parser::{ParseError, Spanning},
DefaultScalarValue, EmptyMutation, FieldError, FieldResult, RootNode, Variables,
DefaultScalarValue, EmptyMutation, FieldError, FieldResult, GraphQLError, RootNode,
Variables,
};
use super::*;
use super::{Connection, ConnectionConfig, NextPayload, Output, SubscribePayload};
struct Context(i32);

View file

@ -23,8 +23,8 @@ use std::{
use juniper::{
futures::{
channel::oneshot,
future::{self, BoxFuture, Either, Future, FutureExt, TryFutureExt},
stream::{self, BoxStream, SelectAll, StreamExt},
future::{self, BoxFuture, Either, Future, FutureExt as _, TryFutureExt as _},
stream::{self, BoxStream, SelectAll, StreamExt as _},
task::{Context, Poll, Waker},
Sink, Stream,
},
@ -547,16 +547,21 @@ where
#[cfg(test)]
mod test {
use std::{convert::Infallible, io};
use std::{convert::Infallible, io, sync::Arc, time::Duration};
use juniper::{
futures::sink::SinkExt,
futures::{
future::{self, FutureExt as _},
sink::SinkExt,
stream::{self, BoxStream, StreamExt as _},
},
graphql_input_value, graphql_object, graphql_subscription, graphql_value, graphql_vars,
parser::{ParseError, Spanning},
DefaultScalarValue, EmptyMutation, FieldError, FieldResult, RootNode, Variables,
DefaultScalarValue, EmptyMutation, FieldError, FieldResult, GraphQLError, RootNode,
Variables,
};
use super::*;
use super::{Connection, ConnectionConfig, ConnectionErrorPayload, DataPayload, StartPayload};
struct Context(i32);

View file

@ -242,10 +242,15 @@ where
#[cfg(test)]
mod whole_responses_stream {
use futures::{stream, StreamExt as _};
use juniper::{graphql_value, DefaultScalarValue, ExecutionError, FieldError};
use std::task::Poll;
use super::*;
use futures::{stream, StreamExt as _};
use juniper::{
graphql_value, DefaultScalarValue, ExecutionError, ExecutionOutput, FieldError, Object,
Value, ValuesStream,
};
use super::whole_responses_stream;
#[tokio::test]
async fn with_error() {