diff --git a/tests/codegen/pass/local_results.rs b/tests/codegen/pass/local_results.rs new file mode 100644 index 000000000..ab3026ecd --- /dev/null +++ b/tests/codegen/pass/local_results.rs @@ -0,0 +1,12 @@ +// Local types overriding the stdlib Result should not affect generated code + +type Result = std::result::Result; + +#[derive(juniper::GraphQLInputObject)] +#[graphql(name = "UserInformation")] +pub struct Update { + pub email: Option, + pub username: Option, +} + +pub fn main() {} diff --git a/tests/codegen/pass/local_send.rs b/tests/codegen/pass/local_send.rs new file mode 100644 index 000000000..2d07b2d05 --- /dev/null +++ b/tests/codegen/pass/local_send.rs @@ -0,0 +1,12 @@ +// Local types overriding the stdlib Send should not affect generated code + +trait Send {} + +#[derive(juniper::GraphQLInputObject)] +#[graphql(name = "UserInformation")] +pub struct Update { + pub email: Option, + pub username: Option, +} + +pub fn main() {} diff --git a/tests/codegen/src/lib.rs b/tests/codegen/src/lib.rs index abdcf2032..f497321ad 100644 --- a/tests/codegen/src/lib.rs +++ b/tests/codegen/src/lib.rs @@ -7,3 +7,10 @@ fn test_failing_compilation() { let t = trybuild::TestCases::new(); t.compile_fail("fail/**/*.rs"); } + +#[rustversion::nightly] +#[test] +fn test_passing_compilation() { + let t = trybuild::TestCases::new(); + t.pass("pass/**/*.rs"); +}