mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
Normalize tests
This commit is contained in:
parent
a40f78f92a
commit
96197e0873
1 changed files with 37 additions and 45 deletions
|
@ -209,24 +209,23 @@ mod tests {
|
||||||
fn test_completion_detail_from_macro_generated_struct_fn_doc_attr() {
|
fn test_completion_detail_from_macro_generated_struct_fn_doc_attr() {
|
||||||
check_detail_and_documentation(
|
check_detail_and_documentation(
|
||||||
r#"
|
r#"
|
||||||
//- /lib.rs
|
macro_rules! bar {
|
||||||
macro_rules! bar {
|
() => {
|
||||||
() => {
|
struct Bar;
|
||||||
struct Bar;
|
impl Bar {
|
||||||
impl Bar {
|
#[doc = "Do the foo"]
|
||||||
#[doc = "Do the foo"]
|
fn foo(&self) {}
|
||||||
fn foo(&self) {}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
bar!();
|
bar!();
|
||||||
|
|
||||||
fn foo() {
|
fn foo() {
|
||||||
let bar = Bar;
|
let bar = Bar;
|
||||||
bar.fo$0;
|
bar.fo$0;
|
||||||
}
|
}
|
||||||
"#,
|
"#,
|
||||||
DetailAndDocumentation { detail: "-> ()", documentation: "Do the foo" },
|
DetailAndDocumentation { detail: "-> ()", documentation: "Do the foo" },
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -235,24 +234,23 @@ mod tests {
|
||||||
fn test_completion_detail_from_macro_generated_struct_fn_doc_comment() {
|
fn test_completion_detail_from_macro_generated_struct_fn_doc_comment() {
|
||||||
check_detail_and_documentation(
|
check_detail_and_documentation(
|
||||||
r#"
|
r#"
|
||||||
//- /lib.rs
|
macro_rules! bar {
|
||||||
macro_rules! bar {
|
() => {
|
||||||
() => {
|
struct Bar;
|
||||||
struct Bar;
|
impl Bar {
|
||||||
impl Bar {
|
/// Do the foo
|
||||||
/// Do the foo
|
fn foo(&self) {}
|
||||||
fn foo(&self) {}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
bar!();
|
bar!();
|
||||||
|
|
||||||
fn foo() {
|
fn foo() {
|
||||||
let bar = Bar;
|
let bar = Bar;
|
||||||
bar.fo$0;
|
bar.fo$0;
|
||||||
}
|
}
|
||||||
"#,
|
"#,
|
||||||
DetailAndDocumentation { detail: "-> ()", documentation: " Do the foo" },
|
DetailAndDocumentation { detail: "-> ()", documentation: " Do the foo" },
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -260,23 +258,17 @@ mod tests {
|
||||||
#[test]
|
#[test]
|
||||||
fn test_no_completions_required() {
|
fn test_no_completions_required() {
|
||||||
// There must be no hint for 'in' keyword.
|
// There must be no hint for 'in' keyword.
|
||||||
check_no_completion(
|
check_no_completion(r#"fn foo() { for i i$0 }"#);
|
||||||
r#"
|
|
||||||
fn foo() {
|
|
||||||
for i i$0
|
|
||||||
}
|
|
||||||
"#,
|
|
||||||
);
|
|
||||||
// After 'in' keyword hints may be spawned.
|
// After 'in' keyword hints may be spawned.
|
||||||
check_detail_and_documentation(
|
check_detail_and_documentation(
|
||||||
r#"
|
r#"
|
||||||
/// Do the foo
|
/// Do the foo
|
||||||
fn foo() -> &'static str { "foo" }
|
fn foo() -> &'static str { "foo" }
|
||||||
|
|
||||||
fn bar() {
|
fn bar() {
|
||||||
for c in fo$0
|
for c in fo$0
|
||||||
}
|
}
|
||||||
"#,
|
"#,
|
||||||
DetailAndDocumentation { detail: "-> &str", documentation: "Do the foo" },
|
DetailAndDocumentation { detail: "-> &str", documentation: "Do the foo" },
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue