Stabilized juniper_tests by using to FnvHashMap
Registry uses fnv::FnvHashMap instead of the std lib HashMap. This commit updates the tests to match.
This commit is contained in:
parent
88f0fdce6f
commit
1acf2067d3
5 changed files with 12 additions and 6 deletions
|
@ -7,6 +7,9 @@ juniper = { path = "../juniper" }
|
|||
juniper_codegen = { path = "../juniper_codegen" }
|
||||
serde_json = { version = "^1.0.2" }
|
||||
|
||||
[dev-dependencies]
|
||||
fnv = "1.0.3"
|
||||
|
||||
[[test]]
|
||||
name = "integration_tests"
|
||||
path = "src/lib.rs"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#[cfg(test)]
|
||||
use std::collections::HashMap;
|
||||
use fnv::FnvHashMap;
|
||||
|
||||
#[cfg(test)]
|
||||
use juniper::{self, FromInputValue, GraphQLType, InputValue, ToInputValue};
|
||||
|
@ -19,7 +19,7 @@ fn test_derived_enum() {
|
|||
assert_eq!(SomeEnum::name(&()), Some("Some"));
|
||||
|
||||
// Ensure validity of meta info.
|
||||
let mut registry = juniper::Registry::new(HashMap::new());
|
||||
let mut registry = juniper::Registry::new(FnvHashMap::default());
|
||||
let meta = SomeEnum::meta(&(), &mut registry);
|
||||
|
||||
assert_eq!(meta.name(), Some("Some"));
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#[cfg(test)]
|
||||
use std::collections::HashMap;
|
||||
use fnv::FnvHashMap;
|
||||
|
||||
#[cfg(test)]
|
||||
use juniper::{self, FromInputValue, GraphQLType, ToInputValue};
|
||||
|
@ -17,7 +17,7 @@ fn test_derived_input_object() {
|
|||
assert_eq!(Input::name(&()), Some("MyInput"));
|
||||
|
||||
// Validate meta info.
|
||||
let mut registry = juniper::Registry::new(HashMap::new());
|
||||
let mut registry = juniper::Registry::new(FnvHashMap::default());
|
||||
let meta = Input::meta(&(), &mut registry);
|
||||
assert_eq!(meta.name(), Some("MyInput"));
|
||||
assert_eq!(meta.description(), Some(&"input descr".to_string()));
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#[cfg(test)]
|
||||
use std::collections::HashMap;
|
||||
use fnv::FnvHashMap;
|
||||
|
||||
#[cfg(test)]
|
||||
use juniper::{self, execute, EmptyMutation, GraphQLType, RootNode, Value, Variables};
|
||||
|
@ -28,7 +28,7 @@ fn test_derived_object() {
|
|||
assert_eq!(Obj::name(&()), Some("MyObj"));
|
||||
|
||||
// Verify meta info.
|
||||
let mut registry = juniper::Registry::new(HashMap::new());
|
||||
let mut registry = juniper::Registry::new(FnvHashMap::default());
|
||||
let meta = Obj::meta(&(), &mut registry);
|
||||
|
||||
assert_eq!(meta.name(), Some("MyObj"));
|
||||
|
|
|
@ -4,4 +4,7 @@ extern crate juniper;
|
|||
extern crate juniper_codegen;
|
||||
extern crate serde_json;
|
||||
|
||||
#[cfg(test)]
|
||||
extern crate fnv;
|
||||
|
||||
mod codegen;
|
||||
|
|
Loading…
Reference in a new issue