Skip to content

Commit 5783848

Browse files
authored
Merge pull request #136 from h-michael/resolve-warning
Resolove warning in test code
2 parents f012cdb + ec37638 commit 5783848

12 files changed

+25
-33
lines changed

tests/alias.rs

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ extern crate serde_json;
1111
query_path = "tests/alias/query.graphql",
1212
schema_path = "tests/alias/schema.graphql"
1313
)]
14-
#[allow(dead_code)]
15-
struct AliasQuery;
14+
pub struct AliasQuery;
1615

1716
#[test]
1817
fn alias() {
@@ -23,17 +22,11 @@ fn alias() {
2322
},
2423
});
2524

26-
let _type_name_test = alias_query::RustAliasQueryOuterAlias {
27-
inner_alias: None,
28-
};
25+
let _type_name_test = alias_query::RustAliasQueryOuterAlias { inner_alias: None };
2926

30-
let valid_alias =
31-
serde_json::from_value::<alias_query::ResponseData>(valid_response).unwrap();
27+
let valid_alias = serde_json::from_value::<alias_query::ResponseData>(valid_response).unwrap();
3228

33-
assert_eq!(
34-
valid_alias.alias.unwrap(),
35-
"127.0.1.2"
36-
);
29+
assert_eq!(valid_alias.alias.unwrap(), "127.0.1.2");
3730
assert_eq!(
3831
valid_alias.outer_alias.unwrap().inner_alias.unwrap(),
3932
"inner value"

tests/custom_scalars.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ type NetworkAddress = Ipv4Addr;
1616
query_path = "tests/custom_scalars/query.graphql",
1717
schema_path = "tests/custom_scalars/schema.graphql"
1818
)]
19-
struct CustomScalarsQuery;
19+
pub struct CustomScalarsQuery;
2020

2121
#[test]
2222
fn custom_scalars() {

tests/deprecation.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,23 @@ extern crate serde_derive;
1010
query_path = "tests/deprecation/query.graphql",
1111
deprecated = "allow",
1212
)]
13-
#[allow(unused_variables)]
14-
struct AllowDeprecation;
13+
pub struct AllowDeprecation;
1514

1615
#[derive(GraphQLQuery)]
1716
#[graphql(
1817
schema_path = "tests/deprecation/schema.graphql",
1918
query_path = "tests/deprecation/query.graphql",
2019
deprecated = "deny",
2120
)]
22-
#[allow(unused_variables)]
23-
struct DenyDeprecation;
21+
pub struct DenyDeprecation;
2422

2523
#[derive(GraphQLQuery)]
2624
#[graphql(
2725
schema_path = "tests/deprecation/schema.graphql",
2826
query_path = "tests/deprecation/query.graphql",
2927
deprecated = "warn",
3028
)]
31-
#[allow(unused_variables)]
32-
struct WarnDeprecation;
29+
pub struct WarnDeprecation;
3330

3431
#[test]
3532
fn deprecation_allow() {

tests/fragments.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ extern crate serde_json;
1111
query_path = "tests/fragments/query.graphql",
1212
schema_path = "tests/fragments/schema.graphql"
1313
)]
14-
#[allow(dead_code)]
15-
struct FragmentReference;
14+
pub struct FragmentReference;
1615

1716
#[test]
1817
fn fragment_reference() {
@@ -24,7 +23,10 @@ fn fragment_reference() {
2423
serde_json::from_value::<fragment_reference::ResponseData>(valid_response).unwrap();
2524

2625
assert_eq!(
27-
valid_fragment_reference.fragment_reference.in_fragment.unwrap(),
26+
valid_fragment_reference
27+
.fragment_reference
28+
.in_fragment
29+
.unwrap(),
2830
"value"
2931
);
3032
}

tests/input_object_variables.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ extern crate serde_json;
1111
schema_path = "tests/input_object_variables/input_object_variables_schema.graphql",
1212
response_derives = "Debug",
1313
)]
14-
struct InputObjectVariablesQuery;
14+
pub struct InputObjectVariablesQuery;
1515

1616
#[test]
1717
fn input_object_variables_query_variables_struct() {
@@ -36,7 +36,7 @@ type Email = String;
3636
schema_path = "tests/input_object_variables/input_object_variables_schema.graphql",
3737
response_derives = "Debug",
3838
)]
39-
struct DefaultInputObjectVariablesQuery;
39+
pub struct DefaultInputObjectVariablesQuery;
4040

4141
#[test]
4242
fn input_object_variables_default() {

tests/interfaces.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const RESPONSE: &'static str = include_str!("interfaces/interface_response.json"
1313
schema_path = "tests/interfaces/interface_schema.graphql",
1414
response_derives = "Debug, PartialEq",
1515
)]
16-
struct InterfaceQuery;
16+
pub struct InterfaceQuery;
1717

1818
#[test]
1919
fn interface_deserialization() {
@@ -60,7 +60,7 @@ fn interface_deserialization() {
6060
schema_path = "tests/interfaces/interface_schema.graphql",
6161
response_derives = "Debug",
6262
)]
63-
struct InterfaceNotOnEverythingQuery;
63+
pub struct InterfaceNotOnEverythingQuery;
6464

6565
const RESPONSE_NOT_ON_EVERYTHING: &'static str =
6666
include_str!("interfaces/interface_response_not_on_everything.json");

tests/introspection.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ extern crate serde_json;
1111
schema_path = "tests/introspection/introspection_schema.graphql",
1212
response_derives = "Debug,PartialEq"
1313
)]
14-
struct IntrospectionQuery;
14+
pub struct IntrospectionQuery;
1515

1616
#[test]
1717
fn introspection_schema() {

tests/more_derives.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ extern crate serde_derive;
1010
query_path = "tests/more_derives/query.graphql",
1111
response_derives = "Debug, PartialEq, PartialOrd",
1212
)]
13-
struct MoreDerives;
13+
pub struct MoreDerives;
1414

1515
#[test]
1616
fn response_derives_can_be_added() {

tests/operation_selection.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ extern crate serde_json;
1111
schema_path = "tests/operation_selection/schema.graphql",
1212
response_derives = "Debug",
1313
)]
14-
struct Heights;
14+
pub struct Heights;
1515

1616
#[derive(GraphQLQuery)]
1717
#[graphql(
1818
query_path = "tests/operation_selection/queries.graphql",
1919
schema_path = "tests/operation_selection/schema.graphql",
2020
response_derives = "Debug",
2121
)]
22-
struct Echo;
22+
pub struct Echo;
2323

2424
const HEIGHTS_RESPONSE: &'static str = r##"{"mountainHeight": 224, "buildingHeight": 12}"##;
2525
const ECHO_RESPONSE: &'static str = r##"{"echo": "tiramisù"}"##;

tests/scalar_variables.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ extern crate serde_json;
1010
query_path = "tests/scalar_variables/scalar_variables_query.graphql",
1111
schema_path = "tests/scalar_variables/scalar_variables_schema.graphql"
1212
)]
13-
struct ScalarVariablesQuery;
13+
pub struct ScalarVariablesQuery;
1414

1515
#[test]
1616
fn scalar_variables_query_variables_struct() {
@@ -25,7 +25,7 @@ fn scalar_variables_query_variables_struct() {
2525
query_path = "tests/scalar_variables/scalar_variables_query_defaults.graphql",
2626
schema_path = "tests/scalar_variables/scalar_variables_schema.graphql"
2727
)]
28-
struct DefaultScalarVariablesQuery;
28+
pub struct DefaultScalarVariablesQuery;
2929

3030
#[test]
3131
fn scalar_variables_default() {

0 commit comments

Comments
 (0)