internal: don't #[ignore] tests

See the style.md for motivation
This commit is contained in:
Aleksey Kladov 2021-06-15 16:37:58 +03:00
parent 1c1f30bebf
commit 4584868a7a
4 changed files with 27 additions and 83 deletions

View file

@ -1130,15 +1130,15 @@ fn foo<'foobar>(_: &'foobar ()) {
} }
#[test] #[test]
#[ignore] // requires the HIR to somehow track these hrtb lifetimes
fn goto_lifetime_hrtb() { fn goto_lifetime_hrtb() {
check( // FIXME: requires the HIR to somehow track these hrtb lifetimes
check_unresolved(
r#"trait Foo<T> {} r#"trait Foo<T> {}
fn foo<T>() where for<'a> T: Foo<&'a$0 (u8, u16)>, {} fn foo<T>() where for<'a> T: Foo<&'a$0 (u8, u16)>, {}
//^^ //^^
"#, "#,
); );
check( check_unresolved(
r#"trait Foo<T> {} r#"trait Foo<T> {}
fn foo<T>() where for<'a$0> T: Foo<&'a (u8, u16)>, {} fn foo<T>() where for<'a$0> T: Foo<&'a (u8, u16)>, {}
//^^ //^^
@ -1147,9 +1147,9 @@ fn foo<T>() where for<'a$0> T: Foo<&'a (u8, u16)>, {}
} }
#[test] #[test]
#[ignore] // requires ForTypes to be implemented
fn goto_lifetime_hrtb_for_type() { fn goto_lifetime_hrtb_for_type() {
check( // FIXME: requires ForTypes to be implemented
check_unresolved(
r#"trait Foo<T> {} r#"trait Foo<T> {}
fn foo<T>() where T: for<'a> Foo<&'a$0 (u8, u16)>, {} fn foo<T>() where T: for<'a> Foo<&'a$0 (u8, u16)>, {}
//^^ //^^

View file

@ -361,8 +361,6 @@ pub struct Foo { pub bar: () }
} }
#[test] #[test]
#[ignore]
// FIXME reenable this test when `Semantics::resolve_record_field` works with union fields
fn fix_visibility_of_union_field() { fn fix_visibility_of_union_field() {
check_assist( check_assist(
fix_visibility, fix_visibility,

View file

@ -811,9 +811,8 @@ fn bar(baz: Baz::Bof) ${0:-> ()} {
} }
#[test] #[test]
#[ignore]
// FIXME fix printing the generics of a `Ty` to make this test pass
fn add_function_with_generic_arg() { fn add_function_with_generic_arg() {
// FIXME: This is wrong, generated `bar` should include generic parameter.
check_assist( check_assist(
generate_function, generate_function,
r" r"
@ -826,7 +825,7 @@ fn foo<T>(t: T) {
bar(t) bar(t)
} }
fn bar<T>(t: T) ${0:-> ()} { fn bar(t: T) ${0:-> ()} {
todo!() todo!()
} }
", ",
@ -834,9 +833,8 @@ fn bar<T>(t: T) ${0:-> ()} {
} }
#[test] #[test]
#[ignore]
// FIXME Fix function type printing to make this test pass
fn add_function_with_fn_arg() { fn add_function_with_fn_arg() {
// FIXME: The argument in `bar` is wrong.
check_assist( check_assist(
generate_function, generate_function,
r" r"
@ -857,7 +855,7 @@ fn foo() {
bar(Baz::new); bar(Baz::new);
} }
fn bar(arg: fn() -> Baz) ${0:-> ()} { fn bar(new: fn) ${0:-> ()} {
todo!() todo!()
} }
", ",
@ -865,9 +863,8 @@ fn bar(arg: fn() -> Baz) ${0:-> ()} {
} }
#[test] #[test]
#[ignore]
// FIXME Fix closure type printing to make this test pass
fn add_function_with_closure_arg() { fn add_function_with_closure_arg() {
// FIXME: The argument in `bar` is wrong.
check_assist( check_assist(
generate_function, generate_function,
r" r"
@ -882,7 +879,7 @@ fn foo() {
bar(closure) bar(closure)
} }
fn bar(closure: impl Fn(i64) -> i64) ${0:-> ()} { fn bar(closure: ()) ${0:-> ()} {
todo!() todo!()
} }
", ",
@ -986,13 +983,10 @@ fn foo() {
} }
#[test] #[test]
#[ignore]
// Ignored until local imports are supported.
// See https://github.com/rust-analyzer/rust-analyzer/issues/1165
fn qualified_path_uses_correct_scope() { fn qualified_path_uses_correct_scope() {
check_assist( check_assist(
generate_function, generate_function,
" r#"
mod foo { mod foo {
pub struct Foo; pub struct Foo;
} }
@ -1001,8 +995,8 @@ fn bar() {
let foo = Foo; let foo = Foo;
baz$0(foo) baz$0(foo)
} }
", "#,
" r#"
mod foo { mod foo {
pub struct Foo; pub struct Foo;
} }
@ -1015,7 +1009,7 @@ fn bar() {
fn baz(foo: foo::Foo) ${0:-> ()} { fn baz(foo: foo::Foo) ${0:-> ()} {
todo!() todo!()
} }
", "#,
) )
} }
@ -1141,40 +1135,29 @@ fn bar() {}
// The assist is only active if the cursor is on an unresolved path, // The assist is only active if the cursor is on an unresolved path,
// but the assist should only be offered if the path is a function call. // but the assist should only be offered if the path is a function call.
generate_function, generate_function,
r" r#"
fn foo() { fn foo() {
bar(b$0az); bar(b$0az);
} }
fn bar(baz: ()) {} fn bar(baz: ()) {}
", "#,
) )
} }
#[test] #[test]
#[ignore]
fn create_method_with_no_args() { fn create_method_with_no_args() {
check_assist( // FIXME: This is wrong, this should just work.
check_assist_not_applicable(
generate_function, generate_function,
r" r#"
struct Foo; struct Foo;
impl Foo { impl Foo {
fn foo(&self) { fn foo(&self) {
self.bar()$0; self.bar()$0;
} }
} }
", "#,
r"
struct Foo;
impl Foo {
fn foo(&self) {
self.bar();
}
fn bar(&self) {
todo!();
}
}
",
) )
} }
} }

View file

@ -93,57 +93,20 @@ mod tests {
} }
#[test] #[test]
#[ignore] // FIXME: Fixtures cant test proc-macros/derives yet as we cant specify them in fixtures
fn empty_derive() { fn empty_derive() {
check( // FIXME: Add build-in derives to fixture.
r#"#[derive($0)] struct Test;"#, check(r#"#[derive($0)] struct Test;"#, expect![[r#""#]]);
expect![[r#"
at Clone
at Clone, Copy
at Debug
at Default
at Hash
at PartialEq
at PartialEq, Eq
at PartialEq, PartialOrd
at PartialEq, Eq, PartialOrd, Ord
"#]],
);
} }
#[test] #[test]
#[ignore] // FIXME: Fixtures cant test proc-macros/derives yet as we cant specify them in fixtures
fn derive_with_input() { fn derive_with_input() {
check( // FIXME: Add build-in derives to fixture.
r#"#[derive(serde::Serialize, PartialEq, $0)] struct Test;"#, check(r#"#[derive(serde::Serialize, PartialEq, $0)] struct Test;"#, expect![[r#""#]])
expect![[r#"
at Clone
at Clone, Copy
at Debug
at Default
at Hash
at Eq
at PartialOrd
at Eq, PartialOrd, Ord
"#]],
)
} }
#[test] #[test]
#[ignore] // FIXME: Fixtures cant test proc-macros/derives yet as we cant specify them in fixtures
fn derive_with_input2() { fn derive_with_input2() {
check( // FIXME: Add build-in derives to fixture.
r#"#[derive($0 serde::Serialize, PartialEq)] struct Test;"#, check(r#"#[derive($0 serde::Serialize, PartialEq)] struct Test;"#, expect![[r#""#]])
expect![[r#"
at Clone
at Clone, Copy
at Debug
at Default
at Hash
at Eq
at PartialOrd
at Eq, PartialOrd, Ord
"#]],
)
} }
} }