Resolve RFC 2565 related todos

This commit is contained in:
nWacky 2019-11-01 13:29:11 +03:00
parent c24687d8bc
commit d22b5c68f3
No known key found for this signature in database
GPG key ID: 22EF2C62F6F79FD0

View file

@ -73,13 +73,12 @@ impl Root {
0
}
// TODO: enable once [RFC 2565](https://github.com/rust-lang/rust/issues/60406) is implemented
// fn attr_arg_descr(#[doc = "The arg"] arg: i32) -> i32 { 0 }
// fn attr_arg_descr_collapse(
// #[doc = "The arg"]
// #[doc = "and more details"]
// arg: i32,
// ) -> i32 { 0 }
fn attr_arg_descr(#[doc = "The arg"] arg: i32) -> i32 { 0 }
fn attr_arg_descr_collapse(
#[doc = "The arg"]
#[doc = "and more details"]
arg: i32,
) -> i32 { 0 }
#[graphql(arguments(arg(default = 123,),))]
fn arg_with_default(arg: i32) -> i32 {
@ -559,73 +558,71 @@ fn introspect_field_multi_args_descr_trailing_comma() {
});
}
// TODO: enable once [RFC 2565](https://github.com/rust-lang/rust/issues/60406) is implemented
// #[test]
// fn introspect_field_attr_arg_descr() {
// run_args_info_query("attrArgDescr", |args| {
// assert_eq!(args.len(), 1);
#[test]
fn introspect_field_attr_arg_descr() {
run_args_info_query("attrArgDescr", |args| {
assert_eq!(args.len(), 1);
// assert!(args.contains(&Value::object(
// vec![
// ("name", Value::scalar("arg")),
// ("description", Value::scalar("The arg")),
// ("defaultValue", Value::null()),
// (
// "type",
// Value::object(
// vec![
// ("name", Value::null()),
// (
// "ofType",
// Value::object(
// vec![("name", Value::scalar("Int"))].into_iter().collect(),
// ),
// ),
// ]
// .into_iter()
// .collect(),
// ),
// ),
// ]
// .into_iter()
// .collect(),
// )));
// });
// }
assert!(args.contains(&Value::object(
vec![
("name", Value::scalar("arg")),
("description", Value::scalar("The arg")),
("defaultValue", Value::null()),
(
"type",
Value::object(
vec![
("name", Value::null()),
(
"ofType",
Value::object(
vec![("name", Value::scalar("Int"))].into_iter().collect(),
),
),
]
.into_iter()
.collect(),
),
),
]
.into_iter()
.collect(),
)));
});
}
// TODO: enable once [RFC 2565](https://github.com/rust-lang/rust/issues/60406) is implemented
// #[test]
// fn introspect_field_attr_arg_descr_collapse() {
// run_args_info_query("attrArgDescrCollapse", |args| {
// assert_eq!(args.len(), 1);
#[test]
fn introspect_field_attr_arg_descr_collapse() {
run_args_info_query("attrArgDescrCollapse", |args| {
assert_eq!(args.len(), 1);
// assert!(args.contains(&Value::object(
// vec![
// ("name", Value::scalar("arg")),
// ("description", Value::scalar("The arg\nand more details")),
// ("defaultValue", Value::null()),
// (
// "type",
// Value::object(
// vec![
// ("name", Value::null()),
// (
// "ofType",
// Value::object(
// vec![("name", Value::scalar("Int"))].into_iter().collect(),
// ),
// ),
// ]
// .into_iter()
// .collect(),
// ),
// ),
// ]
// .into_iter()
// .collect(),
// )));
// });
// }
assert!(args.contains(&Value::object(
vec![
("name", Value::scalar("arg")),
("description", Value::scalar("The arg\nand more details")),
("defaultValue", Value::null()),
(
"type",
Value::object(
vec![
("name", Value::null()),
(
"ofType",
Value::object(
vec![("name", Value::scalar("Int"))].into_iter().collect(),
),
),
]
.into_iter()
.collect(),
),
),
]
.into_iter()
.collect(),
)));
});
}
#[test]
fn introspect_field_arg_with_default() {