From 902df0fc054eb962987a850ba1b32bed59b59623 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Aug 2018 21:42:23 +0300 Subject: add test --- crates/libeditor/src/completion.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'crates/libeditor') diff --git a/crates/libeditor/src/completion.rs b/crates/libeditor/src/completion.rs index 2b6a1db86..42cc656ee 100644 --- a/crates/libeditor/src/completion.rs +++ b/crates/libeditor/src/completion.rs @@ -313,5 +313,14 @@ mod tests { CompletionItem { name: "continue", snippet: Some("continue") }, CompletionItem { name: "break", snippet: Some("break") }, CompletionItem { name: "return", snippet: Some("return $0") }]"#); + check_snippet_completion(r" + fn quux() -> i32 { + loop { || { <|> } } + } + ", r#"[CompletionItem { name: "if", snippet: Some("if $0 { }") }, + CompletionItem { name: "match", snippet: Some("match $0 { }") }, + CompletionItem { name: "while", snippet: Some("while $0 { }") }, + CompletionItem { name: "loop", snippet: Some("loop {$0}") }, + CompletionItem { name: "return", snippet: Some("return $0") }]"#); } } -- cgit v1.2.3