Added tests for no auto-completion on comments
This commit is contained in:
parent
a33eefa3b2
commit
0bbd6428ad
1 changed files with 50 additions and 0 deletions
|
|
@ -1516,4 +1516,54 @@ mod tests {
|
|||
"###
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn no_keyword_autocompletion_on_line_comments() {
|
||||
assert_debug_snapshot!(
|
||||
do_completion(
|
||||
r"
|
||||
fn test() {
|
||||
let x = 2; // A comment<|>
|
||||
}
|
||||
",
|
||||
CompletionKind::Keyword
|
||||
),
|
||||
@r###"
|
||||
[]
|
||||
"###
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn no_keyword_autocompletion_on_multi_line_comments() {
|
||||
assert_debug_snapshot!(
|
||||
do_completion(
|
||||
r"
|
||||
/*
|
||||
Some multi-line comment<|>
|
||||
*/
|
||||
",
|
||||
CompletionKind::Keyword
|
||||
),
|
||||
@r###"
|
||||
[]
|
||||
"###
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn no_keyword_autocompletion_on_doc_comments() {
|
||||
assert_debug_snapshot!(
|
||||
do_completion(
|
||||
r"
|
||||
/// Some doc comment
|
||||
/// let test<|> = 1
|
||||
",
|
||||
CompletionKind::Keyword
|
||||
),
|
||||
@r###"
|
||||
[]
|
||||
"###
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue