juniper/tests/codegen/src/lib.rs
Peter Holloway 801820a3b6
Use fully qualified paths in generated code (#1195)
If user code has a type alias (or custom type) called `Result` or
`Option` etc, this would be used instead of the intended standard
library types causing surprising compile errors from generated code.

Using the fully qualified path allows the generated code to be isolated
from user types.

Includes two basic regression tests covering `Result` and `Send`.

Fixes #1194
2023-10-06 11:59:00 -07:00

16 lines
423 B
Rust
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// TODO: [Object] Type Validation: §4 (interfaces) for objects
// TODO: [Non-Null] §1 A NonNull type must not wrap another NonNull type.
#[rustversion::nightly]
#[test]
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");
}